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

feat(react): remove unsafe lifecycle methods from DataTable and DatePicker #6307

Conversation

joshblack
Copy link
Contributor

@joshblack joshblack commented Jun 17, 2020

Closes #4902

Updates DataTable's usage of UNSAFE_componentWillReceiveProps to componentDidUpdate. The change required some updates to the test file, namely making sure we use the last call to render and calling update for children components to be updated.

This PR also updates DatePicker by converting UNSAFE_componentWillUpdate with componentDidUpdate.

Changelog

New

Changed

  • Convert usage of UNSAFE_componentWillReceiveProps to componentDidUpdate
  • Convert usage of UNSAFE_componentWillUpdate to componentDidUpdate

Removed

Testing / Reviewing

  • Verify storybook samples work as intended

@joshblack joshblack requested a review from a team as a code owner June 17, 2020 21:09
@ghost ghost requested review from aledavila and emyarod June 17, 2020 21:09
@joshblack
Copy link
Contributor Author

Note to reviewers: this was one option I was playing around with, still trying to see if it's the best route versus getDerivedStateFromProps

@joshblack joshblack marked this pull request as draft June 17, 2020 21:18
@netlify
Copy link

netlify bot commented Jun 17, 2020

Deploy preview for carbon-elements ready!

Built with commit 18eecfb

https://deploy-preview-6307--carbon-elements.netlify.app

@netlify
Copy link

netlify bot commented Jun 17, 2020

Deploy preview for carbon-components-react ready!

Built with commit 18eecfb

https://deploy-preview-6307--carbon-components-react.netlify.app

@netlify
Copy link

netlify bot commented Jun 17, 2020

Deploy preview for carbon-components-react ready!

Built with commit 36b2eca

https://deploy-preview-6307--carbon-components-react.netlify.app

@netlify
Copy link

netlify bot commented Jun 17, 2020

Deploy preview for carbon-elements ready!

Built with commit 36b2eca

https://deploy-preview-6307--carbon-elements.netlify.app

@joshblack joshblack changed the title feat(data-table): remove UNSAFE_componentWillReceiveProps Remove unsafe lifecycle methods from DataTable and DatePicker Jun 17, 2020
@joshblack joshblack marked this pull request as ready for review June 17, 2020 22:49
Copy link
Member

@emyarod emyarod left a comment

Choose a reason for hiding this comment

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

looks good to me

packages/react/src/components/DatePicker/DatePicker.js Outdated Show resolved Hide resolved
@joshblack
Copy link
Contributor Author

@aledavila let me know if you want to sync up on reviewing or have any questions!

Copy link
Contributor

@aledavila aledavila left a comment

Choose a reason for hiding this comment

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

@joshblack got it thanks for asking though ! lgtm

@joshblack joshblack changed the title Remove unsafe lifecycle methods from DataTable and DatePicker feat(react): remove unsafe lifecycle methods from DataTable and DatePicker Jun 23, 2020
@joshblack joshblack merged commit 92bfae7 into carbon-design-system:master Jun 23, 2020
@joshblack joshblack deleted the 4902-remove-unsafe-lifecycle-data-table branch June 23, 2020 21:19
gracelo added a commit to gracelo/carbon that referenced this pull request Jun 30, 2020
* origin/master: (77 commits)
  feat(pictograms): add systems devops category and pictograms (carbon-design-system#6332)
  fix(button): prevent tooltip from showing on incorrect hover (carbon-design-system#6349)
  feat(pictograms): add coronavirus pictogram in Life Science category (carbon-design-system#6351)
  chore(npmignore): update npmignore file (carbon-design-system#6350)
  chore(project): sync generated files
  fix(pagination): set correct width on ghost buttons (carbon-design-system#6344)
  docs(text-area): rename story file to use camel case in component name (carbon-design-system#6334)
  chore(release): v10.15.0-rc.0 (carbon-design-system#6343)
  feat(pictograms): New add device pictogram (carbon-design-system#6333)
  fix(Dropdown): add downshiftProps handling (carbon-design-system#6341)
  feat(pictograms): add supply chain category with new pictograms (carbon-design-system#6305)
  feat(pictograms): add gift pictogram in retail (carbon-design-system#6336)
  feat(pictograms): add blender pictogram in lifestyle category (carbon-design-system#6318)
  fix(dropdowns): pass user ID's to Downshift (carbon-design-system#6326)
  fix(carbon): revert pr 6185 (carbon-design-system#6331)
  feat(react): remove unsafe lifecycle methods from DataTable and DatePicker (carbon-design-system#6307)
  docs(handbook): add icon docs to developer-handbook (carbon-design-system#6300)
  feat(pictograms): add planning analytics pictogram to cloud category (carbon-design-system#6320)
  chore(project): sync generated files
  fix(loading): use `$overlay-01` token for overlay (carbon-design-system#6323)
  ...

# Conflicts:
#	packages/components/src/components/tabs/_tabs.scss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove unsafe lifecycle methods from our components
3 participants