Skip to content

Commit 9a3692d

Browse files
authored
docs(tutorials): update file extensions to .ts/.tsx (#4800)
in essentials/part-2-app-structure Signed-off-by: Abdur Rehman <abdur.rehman@linux.com>
1 parent f249591 commit 9a3692d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/tutorials/essentials/part-2-app-structure.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ See [the Redux Thunk docs](../../usage/writing-logic-thunks.mdx), the post [What
655655

656656
Earlier, we saw what a standalone React `<Counter>` component looks like. Our React+Redux app has a similar `<Counter>` component, but it does a few things differently.
657657

658-
We'll start by looking at the `Counter.js` component file:
658+
We'll start by looking at the `Counter.tsx` component file:
659659

660660
```tsx title="features/counter/Counter.tsx"
661661
import { useState } from 'react'
@@ -852,7 +852,7 @@ If you're not sure where to put something, here are some common rules of thumb f
852852

853853
This is also a good example of how to think about forms in Redux in general. **Most form state probably shouldn't be kept in Redux.** Instead, keep the data in your form components as you're editing it, and then dispatch Redux actions to update the store when the user is done.
854854

855-
One other thing to note before we move on: remember that `incrementAsync` thunk from `counterSlice.js`? We're using it here in this component. Notice that we use it the same way we dispatch the other normal action creators. This component doesn't care whether we're dispatching a normal action or starting some async logic. It only knows that when you click that button, it dispatches something.
855+
One other thing to note before we move on: remember that `incrementAsync` thunk from `counterSlice.ts`? We're using it here in this component. Notice that we use it the same way we dispatch the other normal action creators. This component doesn't care whether we're dispatching a normal action or starting some async logic. It only knows that when you click that button, it dispatches something.
856856

857857
## Providing the Store
858858

@@ -887,7 +887,7 @@ root.render(
887887

888888
We always have to call `root.render(<App />)` to tell React to start rendering our root `<App>` component. In order for our hooks like `useSelector` to work right, we need to use a component called `<Provider>` to pass down the Redux store behind the scenes so they can access it.
889889

890-
We already created our store in `app/store.js`, so we can import it here. Then, we put our `<Provider>` component around the whole `<App>`, and pass in the store: `<Provider store={store}>`.
890+
We already created our store in `app/store.ts`, so we can import it here. Then, we put our `<Provider>` component around the whole `<App>`, and pass in the store: `<Provider store={store}>`.
891891

892892
Now, any React components that call `useSelector` or `useDispatch` will be talking to the Redux store we gave to the `<Provider>`.
893893

0 commit comments

Comments
 (0)