Answer the question
In order to leave comments, you need to log in
How to convert Search component to semantic-ui-react on Redux?
There is a task - to implement a search in a .json file using the semantic-ui-react library, namely its Search component using Redux. The official documentation has an example of such an implementation, but only in ReactJS, without Redux. Maybe someone knows what and how to remake it so that it works on Redux?
Here is a link to an example in the sandbox https://codesandbox.io/s/my1n2v6j78?module=/example.js
Thanks a lot in advance!
Answer the question
In order to leave comments, you need to log in
You need to change the filter state in the onSearchChange callback. And you can store the filter at least in the state of the component. Example:
handleSearchChange = (e, { value }) => {
this.setState({ filter: value });
};
const results = data.filter(item => item.title.toLowerCase().includes(filter.toLowerCase()));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question