mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(curriculum): update workshop instructions to clarify named exports with example. (#59190)
This commit is contained in:
+9
-1
@@ -14,7 +14,15 @@ All the CSS have been provided for you so you can focus on creating the navbar.
|
||||
|
||||
Start by defining a `Navbar` functional component that returns a pair of round parentheses. In the next step, you will start to build out the component using JSX.
|
||||
|
||||
Make sure to `export` the component, as it will be imported into the HTML file.
|
||||
Make sure to use a named export when exporting the component, as it will be imported into the HTML file.
|
||||
|
||||
Here is an example of a named export:
|
||||
|
||||
```js
|
||||
export function multiply(a, b) {
|
||||
return a * b;
|
||||
}
|
||||
```
|
||||
|
||||
Also, React functional components need to start with a capital letter because it is a way to differentiate from regular HTML elements.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user