question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ReferenceInput doesn't inject filter prop to child

See original GitHub issue
   // In packages/ra-ui-materialui/src/input/ReferenceInput.spec.tsx 

    it('should pass filter prop to child', () => {
        let gblFilter = {};
        const Component = props => {
            gblFilter = props.filter;
            return <div data-testid="test">Hello</div>;
        };

        render(
            <ReferenceInputView
                {...defaultProps}
                filter={{test: true}}
            >
                <Component/>
            </ReferenceInputView>
        );

        expect(gblFilter).toEqual({test: true});
    });

Environment

  • React-admin version: 3.10.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
fzaninottocommented, Nov 16, 2020

Closing as we only changed an internal API - the public API remains unchanged.

0reactions
WiXSLcommented, Nov 12, 2020

I’ve use ReferenceInputView in the test by copying from another one of your tests. And I assume you did this because is simpler for the tested features but not for what I wanted to test since filter prop is injected from useReferenceInputController to the ReferenceInputView. You might be right about this one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add a filter input based on another filter input on react ...
You might be able to solve this using a FormDataConsumer inside your Filter. <Filter {...props}> <ReferenceInput source="organizationId" .
Read more >
The ReferenceInput Component - React-admin - Marmelab
You can tweak how this component fetches the possible values using the page , perPage , sort , and filter props. // by...
Read more >
Filter Component - ag-Grid (React)
Filter components allow you to add your own filter types to ag-Grid. ... Instead use the React props passed to your Component. destroy()...
Read more >
React Admin Modal: Create Record Without Leaving Page
You should see a list of Posts with options to Add Filter, Create, ... React-Admin uses the Material UI library, so we don...
Read more >
https://raw.githubusercontent.com/marmelab/admin-o...
Changelog ## v1.4.1 * Add `addLabel` default prop in custom Field documentation ... Fix filter in `<ReferenceInput>` not taken into account when ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found