What's the correct way of conditionally returning an input? #662
Replies: 1 comment 4 replies
-
Yeah, we have that there because returning the original value is usually an error. If you do actually need to silence the warning, pass: createSelector(
input1,
input2,
resultFn,
{
devModeChecks: {identityFunctionCheck: 'never'}
}
) |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a selector that conditionally returns one of its inputs:
In reselect 5, this now generates a warning:
The selector seems fine to me as it has the transformation logic in the result function, so I must be missing some detail to fix the root problem.
I have not yet seen a way to silence the warning for a specific selector, so I'm guessing this warning does not produce false positives.
Reproduction Steps
Paste this into your shell to generate a small project that reproduces the situation:
This produces the output:
Beta Was this translation helpful? Give feedback.
All reactions