this is my react code to filter the recommended movies:- filter error
What is wrong with the code? What changes should be done?
react-redux:v7.2.6
moviesData is expecting a type because .filter only works on arrays, type something like this:
type Movie = {
is_premiere: boolean
}
const recommended movies = () => {
const moviesData: Movie[] = useSelector((state) => state.moviesData);
// Rest of your code
}
Sorry for formatting, in typing from my phone