Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 4 additions & 4 deletions docs/api/applyMiddleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,15 @@ store
// I can also dispatch a thunk async action from a component
// any time its props change to load the missing data.

import React from 'react';
import React from 'react'
import { connect } from 'react-redux'

function SandwichShop(props) {
const { dispatch, forPerson } = props;
const { dispatch, forPerson } = props

useEffect(() => {
dispatch(makeASandwichWithSecretSauce(forPerson));
}, [forPerson]);
dispatch(makeASandwichWithSecretSauce(forPerson))
}, [forPerson])

return <p>{this.props.sandwiches.join('mustard')}</p>
}
Expand Down
7 changes: 5 additions & 2 deletions docs/api/bindActionCreators.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ function TodoListContainer(props) {
// We create bound versions of these functions now so we can
// pass them down to our child later.

const boundActionCreators = useMemo(() => bindActionCreators(TodoActionCreators, dispatch), [dispatch]);
const boundActionCreators = useMemo(
() => bindActionCreators(TodoActionCreators, dispatch),
[dispatch]
)
console.log(boundActionCreators)
// {
// addTodo: Function,
Expand All @@ -87,7 +90,7 @@ function TodoListContainer(props) {
// This will work:
let action = TodoActionCreators.addTodo('Use Redux')
dispatch(action)
}, []);
}, [])

return <TodoList todos={todos} {...this.boundActionCreators} />

Expand Down