tcomb-form-native icon indicating copy to clipboard operation
tcomb-form-native copied to clipboard

componentWillReceiveProps deprecated

Open scarlac opened this issue 5 years ago • 4 comments

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

scarlac avatar Aug 23 '19 23:08 scarlac

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

danielzzz avatar Jan 10 '20 15:01 danielzzz

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"

tonycoco avatar Jan 10 '20 18:01 tonycoco

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

Yellowstreak avatar Apr 30 '20 09:04 Yellowstreak

https://blaipratdesaba.com/how-to-use-an-npm-node-module-that-has-been-forked-b7dd522fdd08

microxoft avatar Jun 04 '20 18:06 microxoft