question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Components function warning every time

See original GitHub issue

Created a new react native project and install NativeBase, and call the components from native-base such Container, Text.

There are many warning message display in yellowbox, all related with “componentWillMount”,“componentWillUpdate”,“componentWillReceiveProps” in nativebase components. Warning message will alert in every time when I open those page relate with nativebase. Warning message as below:

_Warning: componentWillMount is deprecated and will be removed in the next major version. Use componentDidMount instead. As a temporary workaround, you can rename to UNSAFE_componentWillMount.

Please update the following components: Container, DrawerLayout, DrawerView, Image, Text, TouchableOpacity, Transitioner, View, withCachedChildNavigation(DrawerScreen), withCachedChildNavigation(DrawerSidebar)

Learn more about this warning here:
https://fb.me/react-async-component-lifecycle-hooks_

My react version info as below:

    "native-base": "^2.3.9",
    "react": "^16.3.0-alpha.1",
    "react-native": "0.54.0",
    "react-native-elements": "^1.0.0-beta2",
    "react-native-vector-icons": "^4.5.0",
    "react-navigation": "^1.4.0"

Thank You.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
SupriyaKalghatgicommented, Apr 12, 2018

NativeBase 2.4.1 works fine with React 16.3.1 and React-Native 0.55.0

No fixes needed from NativeBase side. The reason because React 16.3.0-alpha.1 announced just the warning messages for deprecated lifecycle methods and not introduced its replacements.

React 16.3.1 introduced new aliases for these unsafe lifecycles namely, UNSAFE_componentWillMount, UNSAFE_componentWillReceiveProps and UNSAFE_componentWillUpdate.

https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html

Very soon NativeBase will implement the new static lifecycle methods Stay tuned!

3reactions
SupriyaKalghatgicommented, Sep 3, 2018

@mnlbox About?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Each child in a list should have a unique "key" prop - Stack ...
Warning: Each child in a list should have a unique "key" prop. Check the render method of `MyComponent`. in React. The error message...
Read more >
Understanding the React exhaustive-deps linting warning
When you move from using class components to functional components ... logged in the useEffect every two seconds remains 0 the entire time....
Read more >
Fixing exhaustive-deps warning in some common use cases
Dependency loops​​ Every time we update the prop value, the component should add the new prop value to the existing summation of prop...
Read more >
Fix the "not wrapped in act(...)" warning - Kent C. Dodds
There are a few reasons you're getting this warning. Here's how you fix it.
Read more >
Fix the "Function makes the dependencies of useEffect Hook ...
Every time count changes, we want to run an effect that logs the count ... The logCount function is recreated on each component...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found