Skip to content

Commit bf71dcf

Browse files
committed
Merge branch 'add-rn-and-expo-to-ci' of https://github.com/aryaemami59/react-redux; branch 'master' of https://github.com/reduxjs/react-redux into add-rn-and-expo-to-ci
2 parents 1f026d6 + 35d7ae8 commit bf71dcf

29 files changed

+147
-146
lines changed

docs/api/Provider.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const root = ReactDOM.createRoot(document.getElementById('root'))
8787
root.render(
8888
<Provider store={store}>
8989
<App />
90-
</Provider>
90+
</Provider>,
9191
)
9292
```
9393

@@ -111,6 +111,6 @@ hydrateRoot(
111111
document.getElementById('root'),
112112
<Provider store={clientStore} serverState={preloadedState}>
113113
<App />
114-
</Provider>
114+
</Provider>,
115115
)
116116
```

docs/api/connect.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ If your `mapDispatchToProps` function is declared as taking two parameters, it w
123123
124124
The second parameter is normally referred to as `ownProps` by convention.
125125
126-
```js
126+
```ts
127127
// binds on component re-rendering
128128
<button onClick={() => this.props.toggleTodo(this.props.todoId)} />
129129

@@ -203,7 +203,7 @@ The fields in the plain object you return from it will be used as the props for
203203
204204
The return value of `mergeProps` is referred to as `mergedProps` and the fields will be used as the props for the wrapped component.
205205
206-
> Note: Creating new values in mergeProps will cause re-renders. It is recommended that you memoize fields in order to avoid unnecessary re-renders.
206+
> Note: Creating new values in mergeProps will cause re-renders. It is recommended that you memoize fields in order to avoid unnecessary re-renders.
207207
208208
### `options?: Object`
209209
@@ -229,7 +229,7 @@ You may pass the context to your connected component either by passing it here a
229229
```js
230230
// const MyContext = React.createContext();
231231
connect(mapStateToProps, mapDispatchToProps, null, { context: MyContext })(
232-
MyComponent
232+
MyComponent,
233233
)
234234
```
235235
@@ -450,7 +450,7 @@ function mapDispatchToProps(dispatch) {
450450
return {
451451
actions: bindActionCreators(
452452
{ ...todoActionCreators, ...counterActionCreators },
453-
dispatch
453+
dispatch,
454454
),
455455
}
456456
}
@@ -472,7 +472,7 @@ function mapStateToProps(state) {
472472
function mapDispatchToProps(dispatch) {
473473
return bindActionCreators(
474474
{ ...todoActionCreators, ...counterActionCreators },
475-
dispatch
475+
dispatch,
476476
)
477477
}
478478

docs/api/hooks.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const root = ReactDOM.createRoot(document.getElementById('root'))
3636
root.render(
3737
<Provider store={store}>
3838
<App />
39-
</Provider>
39+
</Provider>,
4040
)
4141
```
4242

@@ -174,7 +174,7 @@ import { createSelector } from 'reselect'
174174

175175
const selectNumCompletedTodos = createSelector(
176176
(state) => state.todos,
177-
(todos) => todos.filter((todo) => todo.completed).length
177+
(todos) => todos.filter((todo) => todo.completed).length,
178178
)
179179

180180
export const CompletedTodosCounter = () => {
@@ -203,12 +203,12 @@ const selectCompletedTodosCount = createSelector(
203203
(state) => state.todos,
204204
(_, completed) => completed,
205205
(todos, completed) =>
206-
todos.filter((todo) => todo.completed === completed).length
206+
todos.filter((todo) => todo.completed === completed).length,
207207
)
208208

209209
export const CompletedTodosCount = ({ completed }) => {
210210
const matchingCount = useSelector((state) =>
211-
selectCompletedTodosCount(state, completed)
211+
selectCompletedTodosCount(state, completed),
212212
)
213213

214214
return <div>{matchingCount}</div>
@@ -364,7 +364,7 @@ export const CounterComponent = ({ value }) => {
364364
const dispatch = useDispatch()
365365
const incrementCounter = useCallback(
366366
() => dispatch({ type: 'increment-counter' }),
367-
[dispatch]
367+
[dispatch],
368368
)
369369

370370
return (
@@ -573,7 +573,7 @@ export function useActions(actions, deps) {
573573
}
574574
return bindActionCreators(actions, dispatch)
575575
},
576-
deps ? [dispatch, ...deps] : [dispatch]
576+
deps ? [dispatch, ...deps] : [dispatch],
577577
)
578578
}
579579
```

docs/introduction/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const root = ReactDOM.createRoot(document.getElementById('root'))
7575
root.render(
7676
<Provider store={store}>
7777
<App />
78-
</Provider>
78+
</Provider>,
7979
)
8080
```
8181

docs/tutorials/connect.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const root = ReactDOM.createRoot(document.getElementById('root'))
9999
root.render(
100100
<Provider store={store}>
101101
<TodoApp />
102-
</Provider>
102+
</Provider>,
103103
)
104104
```
105105

docs/tutorials/quick-start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ root.render(
8080
// highlight-next-line
8181
<Provider store={store}>
8282
<App />
83-
</Provider>
83+
</Provider>,
8484
)
8585
```
8686

docs/using-react-redux/connect-dispatching-actions-with-mapDispatchToProps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ const boundIncrement = bindActionCreators(increment, dispatch)
245245
// binding an object full of action creators
246246
const boundActionCreators = bindActionCreators(
247247
{ increment, decrement, reset },
248-
dispatch
248+
dispatch,
249249
)
250250
// returns
251251
// {

docs/using-react-redux/connect-extracting-data-with-mapStateToProps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default connect(mapStateToProps)(TodoList)
5555
5656
You may define the function with a second argument, `ownProps`, if your component needs the data from its own props to retrieve data from the store. This argument will contain all of the props given to the wrapper component that was generated by `connect`.
5757
58-
```js
58+
```ts
5959
// Todo.js
6060

6161
function mapStateToProps(state, ownProps) {

docs/using-react-redux/usage-with-typescript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ const MyComponent = (props: Props) => (
245245
// Typical usage: `connect` is called after the component is defined
246246
export default connect<StateProps, DispatchProps, OwnProps>(
247247
mapState,
248-
mapDispatch
248+
mapDispatch,
249249
)(MyComponent)
250250
```
251251

src/components/Context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { ProviderProps } from './Provider'
66

77
export interface ReactReduxContextValue<
88
SS = any,
9-
A extends Action<string> = UnknownAction
9+
A extends Action<string> = UnknownAction,
1010
> extends Pick<ProviderProps, 'stabilityCheck' | 'identityFunctionCheck'> {
1111
store: Store<SS, A>
1212
subscription: Subscription

src/components/Provider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { ReactReduxContext } from './Context'
99

1010
export interface ProviderProps<
1111
A extends Action<string> = UnknownAction,
12-
S = unknown
12+
S = unknown,
1313
> {
1414
/**
1515
* The single Redux store in your application.

0 commit comments

Comments
 (0)