Skip to content

Commit

Permalink
Merge branch 'master' into upgrade-babel-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
Maya Vera committed Jan 10, 2022
2 parents 6b9d604 + 120990d commit db7b6ab
Show file tree
Hide file tree
Showing 4 changed files with 424 additions and 16 deletions.
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
Loading

0 comments on commit db7b6ab

Please sign in to comment.