私はエラーを受け取りますCannot read property 'handleDeleteAll' of undefined
。 これは私のコードです:子どもの要素へのアクセス行動
const RecipeList = (props) => {
const Items = props.recipes.map((recipe) => {
return <RecipeListItem key={recipe.id} recipe={recipe} />
});
console.log(props);
return (
<div>
<button onClick={this.props.handleDeleteAll}>Remove All</button>
<div>
{Items}
</div>
</div>
)
}
export default RecipeList;
そして、これはレポです:https://github.com/kstulgys/fcc-recipe-box/blob/master/src/components/RecipeList.js
あまりにも簡単にするために、このライン
。どうもありがとう! – karolis2017