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 strict mode warnings for Collapse component #1992

Merged
merged 4 commits into from Jul 26, 2022
Merged

Fix strict mode warnings for Collapse component #1992

merged 4 commits into from Jul 26, 2022

Conversation

GabrielMajeri
Copy link
Contributor

Updates the react-transition-group dependency to help with compatibility with React strict mode.

Helps towards fixing #1340
Supersedes #1907

@kyletsang
Copy link
Member

Would also need use the nodeRef API, since RTG still uses findDOMNode under the hood.

@GabrielMajeri
Copy link
Contributor Author

Would also need use the nodeRef API, since RTG still uses findDOMNode under the hood.

I've tested the specific component with strict mode and no warnings were shown. How can I can reproduce the situation to get strict mode warnings with RTG?

@kyletsang
Copy link
Member

You'll need to trigger an animation to see the warning, like clicking the toggle button on the collapse examples.

@GabrielMajeri
Copy link
Contributor Author

@kyletsang Thanks for the tips, I've updated the code to use the new nodeRef API.

src/Collapse.js Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@cesarve77
Copy link

Why is not merged?

@GabrielMajeri
Copy link
Contributor Author

@cesarve77 the changes would increase the minimum required React version from 16.3 to 16.6. I can make the changes but I requested some feedback from the maintainers to know if this is the right thing to do.

@stdavis
Copy link

stdavis commented Jun 15, 2022

Is there anything that I can do to help get this merged? The findDOMNode deprecation warning in the console makes me worry.

@GabrielMajeri
Copy link
Contributor Author

GabrielMajeri commented Jun 22, 2022

@stdavis I've updated the PR to the latest master. I've noticed that the library has been updated to use react-transition-group version 4.4.2, hence this isn't a "breaking change" anymore.

I'd ask the library's maintainers to take a look at the changes again and tell me if there's anything else that needs to be done to get this merged. It should fix all of the findDOMNode deprecation warnings, from what I can tell.

@stdavis
Copy link

stdavis commented Jun 22, 2022

This looks good to me! Hopefully it gets some attention. Thanks, @GabrielMajeri !

@karna41317
Copy link

Any updates on this ?

@RichardLindhout
Copy link

Please merge this.

@davidacevedo
Copy link
Collaborator

Seems like the Collapse documentation isn't working after the above changes: https://deploy-preview-1992--reactstrap.netlify.app/?path=/docs/components-collapse--collapse

src/Collapse.js Outdated Show resolved Hide resolved
src/Collapse.js Outdated Show resolved Hide resolved
src/Collapse.js Outdated
@@ -102,6 +110,8 @@ class Collapse extends Component {
...otherProps
} = this.props;

const nodeRef = innerRef || this.nodeRef;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't be needed anymore after the above changes.

@davidacevedo
Copy link
Collaborator

Everything looks good, just a few changes and maybe a rebase is needed as the documentation seems broken for the Collapse component.

@GabrielMajeri
Copy link
Contributor Author

Thank you for the feedback @davidacevedo. I've committed the corresponding changes and rebased the pull request against the latest master.

@GabrielMajeri
Copy link
Contributor Author

I've pushed a new commit, addressing the lint and formatting issues encountered in CI.

@GabrielMajeri GabrielMajeri changed the title Update react-transition-group dependency Fix strict mode warnings for Collapse component Jul 25, 2022
@davidacevedo davidacevedo merged commit 5108720 into reactstrap:master Jul 26, 2022
@GabrielMajeri GabrielMajeri deleted the update-react-transition-group branch July 27, 2022 06:58
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

8 participants