Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useGetMatchingReferenceSelector prop defined but not used. #4313

Closed
WiXSL opened this issue Jan 17, 2020 · 0 comments · Fixed by #4314
Closed

useGetMatchingReferenceSelector prop defined but not used. #4313

WiXSL opened this issue Jan 17, 2020 · 0 comments · Fixed by #4314
Labels

Comments

@WiXSL
Copy link
Contributor

WiXSL commented Jan 17, 2020

I just stumble across the following in current master branch:

useGetMatchingReferenceSelector filter prop is defined but not being used inside the hook.

I believe it could affect the initial value of useReferenceInputController filter prop.

const useGetMatchingReferenceSelector = ({
    referenceSource,
    filter, //  <-- Defined, but not used 
    reference,
    resource,
    source,
    id,
}) => {
    const getMatchingReferences = useCallback(
        state => {
            const referenceResource = getReferenceResource(state, {
                reference,
            });
            const possibleValues = getPossibleReferenceValues(state, {
                referenceSource,
                resource,
                source,
            });

            return getPossibleReferences(referenceResource, possibleValues, [
                id,
            ]);
        },
        [referenceSource, reference, resource, source, id]
    );

    return useSelector(getMatchingReferences);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants