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

Deprecate as="th" on Table Cell #997

Closed
mimarz opened this issue Jan 6, 2021 · 0 comments · Fixed by #1005
Closed

Deprecate as="th" on Table Cell #997

mimarz opened this issue Jan 6, 2021 · 0 comments · Fixed by #1005
Assignees
Labels
core-react eds-core-react

Comments

@mimarz
Copy link
Contributor

mimarz commented Jan 6, 2021

With smart use of Context API, we can know when a <Cell /> needs to be rendered as td or th.

  1. We make a separate "content" context which is used by <Cell />.
  2. We use the context provider in <Head /> and <Body /> and set a "variant" enum to be either head or body for the context value.
  3. The <Cell /> can then determine which type it needs to render based on variant context value.

Notes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-react eds-core-react
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant