1
0
Fork 0

chore: Updated tutorial for v3

This commit is contained in:
joostdecock 2023-09-30 14:04:18 +02:00
parent b5e1554e4f
commit 3bc5fe28de
47 changed files with 2635 additions and 1526 deletions

View file

@ -1,12 +1,12 @@
---
title: A part's draft method
order: 150
order: 50
---
Time to turn our attention to the draft method of our part.
Inside our `design/src/bib.mjs` file, this is what it currently looks like:
Inside our `src/bib.mjs` file, this is what it currently looks like:
```design/src/bib.mjs
```src/bib.mjs
function draftBib({ part }) => {
return part
}
@ -29,7 +29,7 @@ equivalent:
<Tabs tabs="Without destructuring, With destructuring">
<Tab>
```design/src/bib.mjs
```src/bib.mjs
function draftBib(props) {
return props.part
@ -38,7 +38,7 @@ function draftBib(props) {
```
</Tab>
<Tab>
```design/src/bib.mjs
```src/bib.mjs
function draftBib({ part }) {
return part
@ -61,7 +61,7 @@ If you're new to JavaScript, and don't intuitively _get this_, stick with it. It
Change the function to look like this:
```design/src/bib.mjs
```src/bib.mjs
function draftBib({
// highlight-start
Path,
@ -88,6 +88,8 @@ Here's a brief summary of the things we've added above:
- `points`: A container object to hold the part's points
- `paths`: A container object to hold the part's paths
<Tip compact>Remember: Constructures start with a **C**apital letter</Tip>
Long story short: These will make it possible for us to draw points and paths easily.
So let's go ahead and do that.