n4kz / react-native-material-textfield

Material textfield
Other
901 stars 831 forks source link

After upgrade to latest React Native: TypeError: Cannot find property 'style' of undefined #238

Open reuschj opened 4 years ago

reuschj commented 4 years ago

When upgrading to the latest React Native (0.62.0-rc.3), I get an error message, which leads back to 3 files in the react-native-material-textfield package. All seem to point back to the same issue with the latest React Native: Animated.Text.propTypes is now undefined. Here are the three files:

jan-happy commented 4 years ago

RN062-undefined-style-propType.zip Here is an example project with the error.

jan-happy commented 4 years ago

https://github.com/react-native-community/releases/issues/157#issuecomment-595963504

Here is an answer that might help fixing this.

reuschj commented 4 years ago

I had attempted to make a local copy and fix the above issue by remapping to Text.propTypes. This did fix the problem but revealed a bunch of new style issues. As far as I can see, React Native recently made some changes to Animated.Text that break existing code. Notably, the label is initially showing up at the bottom of the text field and the bottom line is too thick. I didn’t have time to work through these issues and just shelved the RN upgrade for the time being. Getting past the 0.60 hurdle has been quite challenging. A lot of major changes that break modules!

ironhide0396 commented 4 years ago

Facing the same issue , any fix found for the above ?

ManasN commented 4 years ago

I am facing the same issue, any fix?

reuschj commented 4 years ago

I think the only options are to wait for this module to be updated for latest React Native versions (0.60+) before upgrading React Native. I had some limited success making a local copy of the module and trying to patch a few of the fixes. The easy one is to just do so and point the 3 files above to Text.propTypes.style.. That worked to allow the app to load the app. However, once loaded, the styling was quite broken in a few places. I didn't have time to do much tinkering, so just shelved my RN upgrade for a bit. Essentially, there are also some big under-the-hood changes to Animated.Text in the latest RN versions that break things. I'm sure it wouldn't be too much of a hurdle to work through them... just not one I had time for.

yardz commented 4 years ago

Same error...

pyataevsv commented 4 years ago

Same error

doctorBeast commented 4 years ago

Same Error ....Do we have fix for this....This issues is holding me back from deploying.

TypeError: Cannot read property 'style' of undefined. File - node_modules/react-native-material-textfield/src/components/label/index.js

guitorioadar commented 3 years ago

Exception

Cannot read property 'style' of undefined.

File - node_modules/react-native-material-textfield/src/components/label/index.js

can anyone help us out with this issue?

farajshuaib commented 3 years ago

I have the same issue but i solve it by finding Text.propTypes.style in node modules react native material dropdown and react native material textfiled and comment it

mehdissp commented 3 years ago

No one found the answer?

Yasin-Ali commented 2 years ago

Similar to @farajshuaib, I solved it by changing Text.propTypes.style to Text?.propTypes?.style

IrfanWani123 commented 2 years ago

Similar to @farajshuaib, I solved it by changing Text.propTypes.style to Text?.propTypes?.style

Ofcourse we can do that but it is not a good option to change the installed package. We then have to do it everytime we install the pakage or if we are working in a team.

jan-happy commented 2 years ago

@IrfanWani123 You could also use https://github.com/ds300/patch-package to patch the package for everybody in your team...

IrfanWani123 commented 2 years ago

@IrfanWani123 You could also use https://github.com/ds300/patch-package to patch the package for everybody in your team...

@jan-happy I did the same with the react-native for some other errors to tackle.

I just wanted to know, after creating the patch for the package, do other teammates have to make the changes manually by checking the patch or is there any way to automatically add the changes to the node modules after installing the packages?

gabrieldonadel commented 2 years ago

Hi everyone, unfortunately this is a known bug in react-native-material-textfield and this lib appears to be abandoned. I suggest you use this fork rn-material-ui-textfield that has fixed this and some other bugs.

If you want to give it a try just run


npm install --save rn-material-ui-textfield
98rahul commented 1 year ago

just upgrading the Rn-0.63.3 to 0.70.5

"react": "18.1.0", "react-native": "0.70.5",

App starts working (as the loging page have not use any dependency🤣)

on entering the application throw ERROR ERROR Error: Requiring module "node_modules\react-native-material-ui\index.js", which threw an exception: TypeError: Cannot read property 'style' of undefined, js engine: hermes

ERROR TypeError: Cannot read property 'Toolbar' of undefined and the last ERROR TypeError: Cannot read property 'style' of undefined, js engine: hermes

please do something .........