mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
fixing highlighting
This commit is contained in:
@@ -20,7 +20,7 @@ That's right, Redux doesn't only work with React. It can be used inside Vue.js,
|
|||||||
|
|
||||||
The store doesn't magically get passed to the views randomly. It has to be supplied by a `react-redux` component called `<Provider>`. It can be placed anywhere, but it's best to just make it available at the root the app:
|
The store doesn't magically get passed to the views randomly. It has to be supplied by a `react-redux` component called `<Provider>`. It can be placed anywhere, but it's best to just make it available at the root the app:
|
||||||
|
|
||||||
```tsx
|
```js
|
||||||
const store = createStore(reducers);
|
const store = createStore(reducers);
|
||||||
|
|
||||||
const App = () => {
|
const App = () => {
|
||||||
@@ -36,7 +36,7 @@ const App = () => {
|
|||||||
|
|
||||||
Connect store to view with `react-redux`. `connect()` is used to turn Redux store and dispatch functions into props inside React components. The state and action dispatchers are passed along with a `<Provider>` component.
|
Connect store to view with `react-redux`. `connect()` is used to turn Redux store and dispatch functions into props inside React components. The state and action dispatchers are passed along with a `<Provider>` component.
|
||||||
|
|
||||||
```ts
|
```js
|
||||||
const OldComponent = props => {
|
const OldComponent = props => {
|
||||||
return <div>{props.foo}</div>;
|
return <div>{props.foo}</div>;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user