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

[Question]can react-datasheet work with Redux? #279

Open
wangchen-ca opened this issue Apr 22, 2021 · 1 comment
Open

[Question]can react-datasheet work with Redux? #279

wangchen-ca opened this issue Apr 22, 2021 · 1 comment

Comments

@wangchen-ca
Copy link

wangchen-ca commented Apr 22, 2021

I start on boarding an existing application and learn react and Redux. I have a application using Redux and it uses axios to retrieve remote service url. The return dispatch a action to update state to call the parent component's render to show a data sheet to make user input form. The sheet data is a promise or not available when the render firstly called. I see the log, first time the render called, data in is a empty object, on following calls, real data comes.

I see your examples that data are given as property of component in react render function. Redux enables react app to update state by using action, and render being automatically called to refresh display.

My question, can react-datasheet working with Redux? or if underline data in state changes, what to do to let the sheet to refresh display with new data?

Any advice on my case?

Thanks,
Chen

@mungojam
Copy link
Contributor

We're happily using it with redux. We the react-redux useSelector hook and then just set the data props on the table from that and it will update automatically since it is 'declarative' not 'imperative'

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

No branches or pull requests

2 participants