The app i made is a movie website that shows movies based on your search. You can also add favorites, however its not linked to your profile. So the solution i came up with was to make another value in the profile initial state in redux.
export const profileInitialState = [
{pass: '123', user: 'daniel', email: 'daniel@123.com', favourites: 'batman' },
]
interface IProfileState {
pass: string,
user: string,
email: string,
favourites?: string
}
and just map it from there
{data.profileReducer.slice(data.profileReducer.indexOf( {user: currUser, pass: password, email: email}, 1)).map(info =>
<p key={data.profileReducer.length + 1.5} > {info.favourites} </p>)}
and even thought it works perfectly in the console, it tell me profileReducer.indexOf is not a function when i implement it in my code.