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

Allow customizing the key property type #2311

Merged
merged 8 commits into from
May 11, 2021
Merged

Conversation

danielpza
Copy link
Contributor

Why? This fails:

const [selected, setSelected] = new Set<string>([])

<DataGrid selectedRows={selected} onSelectedRowsChange={setSelected} />

because onSelectedRowsChange was expected to receive all the properties React.Key has, eg number, which is not possible/desired.

@danielpza danielpza changed the title Allow customizing the key property Allow customizing the key property type Feb 22, 2021
@danielpza
Copy link
Contributor Author

@amanmahajan7 can you comment on if is going to be accepted or if there a problem with the PR?

Copy link
Contributor

@nstepien nstepien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a good idea.
Can you please also add the generic to the default export, it's at the end of DataGrid.tsx.

src/DataGrid.tsx Outdated Show resolved Hide resolved
Co-authored-by: Nicolas Stepien <567105+nstepien@users.noreply.github.com>
@nstepien
Copy link
Contributor

Please also add the generic to the default export at the end of DataGrid.tsx, it won't be usable otherwise.

src/DataGrid.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@nstepien nstepien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks!

@nstepien nstepien merged commit 4208059 into adazzle:canary May 11, 2021
@danielpza danielpza deleted the patch-1 branch May 12, 2021 00:08
@danielpza
Copy link
Contributor Author

Thank you! 🎉

gernotkogler pushed a commit to Garaio-REM/react-data-grid that referenced this pull request May 13, 2021
* Allow customizing the key property

* Update DataGrid.tsx

* Update DataGrid.tsx

* Update src/DataGrid.tsx

Co-authored-by: Nicolas Stepien <567105+nstepien@users.noreply.github.com>

* update

* Update src/DataGrid.tsx

Co-authored-by: Nicolas Stepien <567105+nstepien@users.noreply.github.com>
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