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

componentWillReceiveProps deprecated #579

Open
scarlac opened this issue Aug 23, 2019 · 4 comments
Open

componentWillReceiveProps deprecated #579

scarlac opened this issue Aug 23, 2019 · 4 comments

Comments

@scarlac
Copy link

scarlac commented Aug 23, 2019

Version

Tell us which versions you are using:

  • tcomb-form-native v0.6.20
  • react-native v0.60.4

Expected behaviour

No warning generated when rendering a Form component.

Actual behaviour

A warning is generated when rendering a Form component.

Warning: componentWillReceiveProps is deprecated and will be removed in the next major version. Use static getDerivedStateFromProps instead.

Please update the following components: Component

Steps to reproduce

  1. Create a Form with a Textbox in it
  2. Have it rendered
  3. Warning appears

Stack trace and console log

YellowBox.js:71 Warning: componentWillReceiveProps is deprecated and will be removed in the next major version. Use static getDerivedStateFromProps instead.

Please update the following components: Component

Learn more about this warning here:
https://fb.me/react-async-component-lifecycle-hooks
console.warn @ YellowBox.js:71
printWarning @ ReactNativeRenderer-dev.js:6429
lowPriorityWarning @ ReactNativeRenderer-dev.js:6457
ReactStrictModeWarnings.flushPendingDeprecationWarnings @ ReactNativeRenderer-dev.js:6601
flushRenderPhaseStrictModeWarningsInDEV @ ReactNativeRenderer-dev.js:18529
commitRootImpl @ ReactNativeRenderer-dev.js:17863
unstable_runWithPriority @ scheduler.development.js:471
runWithPriority @ ReactNativeRenderer-dev.js:5532
commitRoot @ ReactNativeRenderer-dev.js:17845
runRootCallback @ ReactNativeRenderer-dev.js:17218
flushImmediateQueueImpl @ ReactNativeRenderer-dev.js:5581
flushImmediateQueue @ ReactNativeRenderer-dev.js:5568
scheduleUpdateOnFiber @ ReactNativeRenderer-dev.js:17073
enqueueSetState @ ReactNativeRenderer-dev.js:7912
Component.setState @ react.development.js:335
componentDidMount$ @ createAppContainer.js:297
tryCatch @ runtime.js:45
invoke @ runtime.js:271
prototype.(anonymous function) @ runtime.js:97
tryCatch @ runtime.js:45
invoke @ runtime.js:135
(anonymous) @ runtime.js:145
tryCallOne @ core.js:37
(anonymous) @ core.js:123
(anonymous) @ JSTimers.js:289
_callTimer @ JSTimers.js:146
_callImmediatesPass @ JSTimers.js:194
callImmediates @ JSTimers.js:458
__callImmediates @ MessageQueue.js:366
(anonymous) @ MessageQueue.js:135
__guard @ MessageQueue.js:343
flushedQueue @ MessageQueue.js:134
invokeCallbackAndReturnFlushedQueue @ MessageQueue.js:130
e @ RNDebuggerWorker.js:1
@danielzzz
Copy link

danielzzz commented Jan 10, 2020

any news on this one? still having this problem in Jan, 2020

@tonycoco
Copy link
Contributor

Fixed it on a branch here: https://github.com/tonycoco/tcomb-form-native/tree/UNSAFE_componentWillReceiveProps

PR #583

Use it:

"tcomb-form-native": "github:tonycoco/tcomb-form-native#UNSAFE_componentWillReceiveProps"

@Yellowstreak
Copy link

Total noob to gituhb. How do I install this version into my React Native project using npm?

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

No branches or pull requests

5 participants