Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jayair committed Dec 29, 2019
2 parents 07a7042 + 74d3d2f commit 183e32d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion _chapters/add-the-session-to-the-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default function AppliedRoute({ component: C, appProps, ...rest }) {
}
```

This simple component creates a `Route` where the child component that it renders contains the passed in props. Let's take a quick look at how this being done.
This simple component creates a `Route` where the child component that it renders contains the passed in props. Let's take a quick look at how this is being done.

- The `Route` component takes a prop called `component` that represents the component that will be rendered when a matching route is found. We want our `appProps` to be applied to this component.

Expand Down
4 changes: 2 additions & 2 deletions _chapters/load-the-state-from-the-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ async function onLoad() {

Let's understand how this and the `useEffect` hook works.

The `useEffect` hook take a function and an array of variables. The function will be called every time the component is rendered. And the array of variables tell React to only re-run our function if the passed in array of variables have changed. This allows us to control when our function gets run. This has some neat consequences:
The `useEffect` hook takes a function and an array of variables. The function will be called every time the component is rendered. And the array of variables tell React to only re-run our function if the passed in array of variables have changed. This allows us to control when our function gets run. This has some neat consequences:

1. If we don't pass in an array of variables, our hook get's executed everytime our component is rendered.
1. If we don't pass in an array of variables, our hook gets executed everytime our component is rendered.
2. If we pass in some variables, on every render React will first check if those variables have changed, before running our function.
3. If we pass in an empty list of variables, then it'll only run our function on the FIRST render.

Expand Down
2 changes: 1 addition & 1 deletion _chapters/upload-a-file-to-s3.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Also, just looking ahead a bit; we will be uploading files when a note is create

### Upload to S3

<img class="code-marker" src="/assets/s.png" />Add the following to `src/libs/awsLib.js`.
<img class="code-marker" src="/assets/s.png" />Create `src/libs/awsLib.js` and add the following:

``` javascript
import { Storage } from "aws-amplify";
Expand Down

0 comments on commit 183e32d

Please sign in to comment.