You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Can anyone tell me how can I share a state of the Landing component into the App so that I can distinguish a searchTerm in the Search component? Basically, I'd like to make the Landing component working.
Now I want this beforeSearchTerm state send into Search component so I can distinguish searchTerm, maybe sth like this-> if I pass sth in Landing component (beforeSearchTerm) then let Search state be beforeSearchTerm, if I don't pass any value then let Search state be empty string:
class Search extends Component {
state = {
searchTerm: beforeSearchTerm ? {`${beforeSearchTerm}`} : ''
};
The text was updated successfully, but these errors were encountered:
Hi,
Can anyone tell me how can I share a state of the Landing component into the App so that I can distinguish a searchTerm in the Search component? Basically, I'd like to make the Landing component working.
This is sth that Brian talks about in the React Wrapper in the chapter 'Data in React' (FEM course).
https://frontendmasters.com/courses/react/wrapper-and-q-a/
I've been trying to refactor Landing.jsx. Now it looks like this:
Now I want this beforeSearchTerm state send into Search component so I can distinguish searchTerm, maybe sth like this-> if I pass sth in Landing component (beforeSearchTerm) then let Search state be beforeSearchTerm, if I don't pass any value then let Search state be empty string:
The text was updated successfully, but these errors were encountered: