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

[RFR] Add useListController hook #3377

Merged
merged 2 commits into from
Jul 2, 2019
Merged

[RFR] Add useListController hook #3377

merged 2 commits into from
Jul 2, 2019

Conversation

fzaninotto
Copy link
Member

It helps remove one level in the component tree for lists, and makes the return type explicit. Also, it's easier to understand.

import {useListController } from 'react-admin';
import ListView from './ListView';

const MyList = props => {
    const controllerProps = useListController(props);
    return <ListView {...controllerProps} {...props} />;
}

The ListController component remains for backward compatibility, and to be able to test useListController.

There will be more such controllers (useEditController, etc) but Rome wasn't built in one day.

@fzaninotto fzaninotto added this to the 3.0.0 milestone Jul 2, 2019
@djhi djhi merged commit 4e95310 into next Jul 2, 2019
@djhi djhi deleted the useListController branch July 2, 2019 07:40
@fzaninotto fzaninotto mentioned this pull request Jul 14, 2019
40 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants