Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions exercises/03-separate-files/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const sum = (a,b) => {
export default sum; //export
```


```js
// file2.js

Expand All @@ -22,12 +23,12 @@ import sum from './file1.js';
console.log(sum(2,2)); //will output 4
```

The best usage for this feature is to separate each component in a different file to keep the code organized.
The intended usage of this feature is the ability to separate each component in its own file, in order to keep the code organized. Divide and conquer.

## Instructions

Right now, there is a componented declared on the file whatToRender.js and it is being exported as default.
You have two files now: index.js and whatToRender.js, in the former you'll find a Component which is being exported as default.

Open the index.js file and import as default the WhatToRender function, keep the same variable name __WhatToRender__
Open the index.js file and import the WhatToRender function (as default). Note: keep the same variable name __WhatToRender__.

If you imported correctly you will see the "hello world" on the screen.
If you imported correctly you will see the "hello world" on the screen.