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

Navbar Uses componentWillMount Still #4240

Closed
WretchedDade opened this issue Aug 13, 2019 · 8 comments · Fixed by #4258
Closed

Navbar Uses componentWillMount Still #4240

WretchedDade opened this issue Aug 13, 2019 · 8 comments · Fixed by #4258

Comments

@WretchedDade
Copy link

Describe the bug

I was getting a warnings after setting up some unit tests in my project. After digging in it looks like the Navbar component still uses componentWillMount. It looks like other components are being updated to use the hook form of uncontrollable (useUncontrollable). Are there plans and/or a timeline for Navbar to be updated to no longer depend on the legacy versions of these lifecycle hooks? It's not a pressing issue, just a bit of an eyesore!

Screenshots

image

image

@mxschmitt mxschmitt added the Bootstrap 3 Bootstrap 3 label Aug 13, 2019
@mxschmitt
Copy link
Member

@WretchedDade which version of react-bootstrap are you using?

@mxschmitt mxschmitt added the needs more info Issue requires more information from poster label Aug 13, 2019
@WretchedDade
Copy link
Author

1.0.0-beta.11

@mxschmitt mxschmitt removed the Bootstrap 3 Bootstrap 3 label Aug 14, 2019
@Noisycall
Copy link

Warning received when using Navbar

React - Bootstrap version 1.0.0-beta11

React - 16.9.0

Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

  • Move code with side effects to componentDidMount, and set initial state in the constructor.
  • Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run npx react-codemod rename-unsafe-lifecycles in your project source folder.

Please update the following components: Uncontrolled(Navbar)

@dons20
Copy link

dons20 commented Aug 14, 2019

#4244 should fix this hopefully

@taion
Copy link
Member

taion commented Aug 14, 2019

#4244 targets the v3 compat branch. We'd be happy to take a PR addressing v1, though.

That said these warnings are basically innocuous for now.

@cliffhall
Copy link

cliffhall commented Aug 14, 2019

@taion The message may be innocuous but I have zero-tolerance for warning and error output in my console :) Which branch do you need a PR for?

Screen Shot 2019-08-14 at 3 52 53 PM

@taion
Copy link
Member

taion commented Aug 14, 2019

master

bpas247 added a commit that referenced this issue Aug 14, 2019
This migrates the Navbar component to be a function component,
which should resolve the lifecycle deprecation warnings.

fixes #4240
@bpas247 bpas247 added Issue Taken! and removed needs more info Issue requires more information from poster labels Aug 15, 2019
@WretchedDade
Copy link
Author

Woo! Thanks everyone!

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

Successfully merging a pull request may close this issue.

7 participants