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

fix: Use references to renderers instead of inline functions #2584

Merged
merged 1 commit into from
Jul 30, 2020

Conversation

kizu
Copy link
Contributor

@kizu kizu commented Jul 30, 2020

In order to be able to check if a column has a default renderer, we need them to be exposed constants instead of inline functions.

This way we could do, say:

import { emptyRenderer } from 'react-table';
// …
if (column.Header === emptyRenderer) {
  // …
}

Right now these are inline functions that cannot be compared with anything, so having publicly available references to these could help a lot when developing plugin-hooks that work with columns.

In order to be able to check if a column has a default renderer, we need them to be exposed constants instead of inline functions.
@vercel
Copy link

vercel bot commented Jul 30, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/tannerlinsley/react-table/fp5tfrfn0
✅ Preview: https://react-table-git-fork-kizu-default-renderers.tannerlinsley.vercel.app

@tannerlinsley tannerlinsley merged commit aa28357 into TanStack:master Jul 30, 2020
@kizu kizu deleted the default-renderers branch July 30, 2020 14:41
@tannerlinsley
Copy link
Collaborator

🎉 This PR is included in version 7.3.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nextglabs
Copy link

nextglabs commented Sep 13, 2021

Very nice, but this seems like the emptyRenderer function is missing from the Typescript types (tested with @types/[email protected])

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 this pull request may close these issues.

4 participants