Answer the question
In order to leave comments, you need to log in
How to link to images correctly?
I am writing an application in React and Cordova. I ran into a problem with specifying image addresses: on the web they start with a slash, in cordova they must be absolute paths to the file system. The project was created using the cordova and create-react-app utilities.
How do I configure webpack or cordova to accommodate these specifics?
Answer the question
In order to leave comments, you need to log in
What's the point of writing state from store to component state? Use the state from the store directly.
The best thing, in this case, is to store the filter state somewhere and filter the data from the store on the fly.
const phoneList = useSelector((state) => state.phoneListReducer.phoneList);
const [search, setSearch] = useState('');
const filteredPhoneList = useMemo(
() => phoneList.filter(phone => phone.includes(search)),
[search],
);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question