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: replaced deprecated UNSAFE_componentWillReceiveProps with componentDidUpdate #3923

Conversation

lrozewicz
Copy link
Contributor

Reasons for making this change

I have replaced the deprecated UNSAFE_componentWillReceiveProps() method in the Form.tsx component with an improved solution utilizing the React lifecycle methods: getSnapshotBeforeUpdate() and componentDidUpdate().

fixes #1794

Checklist

  • I'm updating documentation
  • I've checked the rendering of the Markdown text I've added
  • I'm adding or updating code
  • I've added and/or updated tests. I've run npm run test:update to update snapshots, if needed.
  • I've updated docs if needed
  • I've updated the changelog with a description of the PR
  • I'm adding a new feature
  • I've updated the playground with an example use of the feature

@lrozewicz lrozewicz force-pushed the feature/removed_UNSAFE_componentWillReceiveProps branch from b94f24d to 5faa87d Compare October 26, 2023 19:25
@heath-freenome heath-freenome changed the title fix: repalced deprecated UNSAFE_componentWillReceiveProps with componentDidUpdate fix: replaced deprecated UNSAFE_componentWillReceiveProps with componentDidUpdate Oct 27, 2023
packages/core/src/components/Form.tsx Outdated Show resolved Hide resolved
packages/core/src/components/Form.tsx Outdated Show resolved Hide resolved
packages/core/test/Form.test.jsx Outdated Show resolved Hide resolved
@heath-freenome
Copy link
Member

Looks good otherwise! Thanks for doing this!

@heath-freenome heath-freenome merged commit fb7adf2 into rjsf-team:main Oct 28, 2023
4 checks passed
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.

Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended
2 participants