Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format all files #2125

Merged
merged 3 commits into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions docs/api/Provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const root = ReactDOM.createRoot(document.getElementById('root'))
root.render(
<Provider store={store}>
<App />
</Provider>
</Provider>,
)
```

Expand All @@ -111,6 +111,6 @@ hydrateRoot(
document.getElementById('root'),
<Provider store={clientStore} serverState={preloadedState}>
<App />
</Provider>
</Provider>,
)
```
10 changes: 5 additions & 5 deletions docs/api/connect.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ The second parameter is normally referred to as `ownProps` by convention.

```js
// binds on component re-rendering
<button onClick={() => this.props.toggleTodo(this.props.todoId)} />
;<button onClick={() => this.props.toggleTodo(this.props.todoId)} />
aryaemami59 marked this conversation as resolved.
Show resolved Hide resolved

// binds on `props` change
const mapDispatchToProps = (dispatch, ownProps) => ({
Expand Down Expand Up @@ -203,7 +203,7 @@ The fields in the plain object you return from it will be used as the props for

The return value of `mergeProps` is referred to as `mergedProps` and the fields will be used as the props for the wrapped component.

> Note: Creating new values in mergeProps will cause re-renders. It is recommended that you memoize fields in order to avoid unnecessary re-renders.
> Note: Creating new values in mergeProps will cause re-renders. It is recommended that you memoize fields in order to avoid unnecessary re-renders.

### `options?: Object`

Expand All @@ -229,7 +229,7 @@ You may pass the context to your connected component either by passing it here a
```js
// const MyContext = React.createContext();
connect(mapStateToProps, mapDispatchToProps, null, { context: MyContext })(
MyComponent
MyComponent,
)
```

Expand Down Expand Up @@ -450,7 +450,7 @@ function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators(
{ ...todoActionCreators, ...counterActionCreators },
dispatch
dispatch,
),
}
}
Expand All @@ -472,7 +472,7 @@ function mapStateToProps(state) {
function mapDispatchToProps(dispatch) {
return bindActionCreators(
{ ...todoActionCreators, ...counterActionCreators },
dispatch
dispatch,
)
}

Expand Down
12 changes: 6 additions & 6 deletions docs/api/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const root = ReactDOM.createRoot(document.getElementById('root'))
root.render(
<Provider store={store}>
<App />
</Provider>
</Provider>,
)
```

Expand Down Expand Up @@ -174,7 +174,7 @@ import { createSelector } from 'reselect'

const selectNumCompletedTodos = createSelector(
(state) => state.todos,
(todos) => todos.filter((todo) => todo.completed).length
(todos) => todos.filter((todo) => todo.completed).length,
)

export const CompletedTodosCounter = () => {
Expand Down Expand Up @@ -203,12 +203,12 @@ const selectCompletedTodosCount = createSelector(
(state) => state.todos,
(_, completed) => completed,
(todos, completed) =>
todos.filter((todo) => todo.completed === completed).length
todos.filter((todo) => todo.completed === completed).length,
)

export const CompletedTodosCount = ({ completed }) => {
const matchingCount = useSelector((state) =>
selectCompletedTodosCount(state, completed)
selectCompletedTodosCount(state, completed),
)

return <div>{matchingCount}</div>
Expand Down Expand Up @@ -364,7 +364,7 @@ export const CounterComponent = ({ value }) => {
const dispatch = useDispatch()
const incrementCounter = useCallback(
() => dispatch({ type: 'increment-counter' }),
[dispatch]
[dispatch],
)

return (
Expand Down Expand Up @@ -573,7 +573,7 @@ export function useActions(actions, deps) {
}
return bindActionCreators(actions, dispatch)
},
deps ? [dispatch, ...deps] : [dispatch]
deps ? [dispatch, ...deps] : [dispatch],
)
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/introduction/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const root = ReactDOM.createRoot(document.getElementById('root'))
root.render(
<Provider store={store}>
<App />
</Provider>
</Provider>,
)
```

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/connect.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const root = ReactDOM.createRoot(document.getElementById('root'))
root.render(
<Provider store={store}>
<TodoApp />
</Provider>
</Provider>,
)
```

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ root.render(
// highlight-next-line
<Provider store={store}>
<App />
</Provider>
</Provider>,
)
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ const boundIncrement = bindActionCreators(increment, dispatch)
// binding an object full of action creators
const boundActionCreators = bindActionCreators(
{ increment, decrement, reset },
dispatch
dispatch,
)
// returns
// {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function mapStateToProps(state, ownProps) {
}

// Later, in your application, a parent component renders:
<ConnectedTodo id={123} />
;<ConnectedTodo id={123} />
// and your component receives props.id, props.todo, and props.visibilityFilter
```

Expand Down
2 changes: 1 addition & 1 deletion docs/using-react-redux/usage-with-typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ const MyComponent = (props: Props) => (
// Typical usage: `connect` is called after the component is defined
export default connect<StateProps, DispatchProps, OwnProps>(
mapState,
mapDispatch
mapDispatch,
)(MyComponent)
```

Expand Down
2 changes: 1 addition & 1 deletion src/components/Context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { ProviderProps } from './Provider'

export interface ReactReduxContextValue<
SS = any,
A extends Action<string> = UnknownAction
A extends Action<string> = UnknownAction,
> extends Pick<ProviderProps, 'stabilityCheck' | 'identityFunctionCheck'> {
store: Store<SS, A>
subscription: Subscription
Expand Down
2 changes: 1 addition & 1 deletion src/components/Provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ReactReduxContext } from './Context'

export interface ProviderProps<
A extends Action<string> = UnknownAction,
S = unknown
S = unknown,
> {
/**
* The single Redux store in your application.
Expand Down
Loading
Loading