Can you pass down state to child components with React Hooks?

Yes, as far as passing down props are concerned there is no difference in usage with React Hooks. In the snippet you’ve provided just pass setSearchData as a prop to PostContainer.

<PostContainer
  data={dataOnMap}
  addLike={addLike[index]}
  searchData={searchData}
  setSearchData={setSearchData}
/>

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)