0

I would like to make a selector function like so:

const selectSomethingById = (state, id) => return state.something[id];

I cannot make it to work. I would have some components calling it like so:

const something = useSelector(selectSomethingById(id));

1 Answer 1

1
const something = useSelector(state => selectSomethingById(state, id))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.