Coder Social home page Coder Social logo

Warning: Dialog.Loading: Support for defaultProps will be removed from function components in a future major release. about react-native-elements HOT 19 OPEN

vijaychouhan-rails avatar vijaychouhan-rails commented on September 26, 2024 10
Warning: Dialog.Loading: Support for defaultProps will be removed from function components in a future major release.

from react-native-elements.

Comments (19)

rob-pathway avatar rob-pathway commented on September 26, 2024 10

Also having this issue with <Slider />

from react-native-elements.

joesingtecs avatar joesingtecs commented on September 26, 2024 3

Having the same issue. Is there an update on where this might be fixed?

from react-native-elements.

keisan1231 avatar keisan1231 commented on September 26, 2024 1

<Overlay/> same error ("react-native-elements": "^3.4.3",)

Warning: Overlay: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.

from react-native-elements.

mgreer avatar mgreer commented on September 26, 2024 1

This wonderful library looks like the maintainer has run out of steam recently. Maybe you could fork it with your fix? Then PR against the main repo so they can merge/comment on it, or if they never do your fixed fork becomes the latest.

from react-native-elements.

helloitsmix avatar helloitsmix commented on September 26, 2024

Have the same warning

from react-native-elements.

vaniapsk avatar vaniapsk commented on September 26, 2024

Same here, having the same issue with <Slider />

from react-native-elements.

antoniovuono avatar antoniovuono commented on September 26, 2024

Same problem here with <Dialog.Loading />

from react-native-elements.

Emauss avatar Emauss commented on September 26, 2024

Same issue in <CheckBox />
But with TextElement:

"Use JavaScript default parameters instead. %s TextElement"

from react-native-elements.

acmasters17 avatar acmasters17 commented on September 26, 2024

Yeah, we are also having the warning with the component, the only thing I've seen as a workaround / temp fix for this has been people suppressing the warn but I don't think that is the correct approach. I think likely may require an underlying code change for the components in this library and waiting until that happens 😢

from react-native-elements.

Kenny0105 avatar Kenny0105 commented on September 26, 2024

Same issue for here, any updates?

from react-native-elements.

Metecko avatar Metecko commented on September 26, 2024

same issue :(

from react-native-elements.

boiboif avatar boiboif commented on September 26, 2024

Same issue

from react-native-elements.

KarlaSaenz avatar KarlaSaenz commented on September 26, 2024

Same issue in
<CheckBox /> <ButtonGroup/>

from react-native-elements.

endp01 avatar endp01 commented on September 26, 2024

Same issue (with Dialog.Button), running rneui 4.0.0-rc.7

ERROR Warning: Dialog.Button: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.

issue probably here:

seems it stems from recent changes in react 18.13.1: facebook/react#29233

probably needs a fix in all components 🥵

from react-native-elements.

matheus-reif avatar matheus-reif commented on September 26, 2024

I also have the same issue with version 3.4.3

from react-native-elements.

JackCat1 avatar JackCat1 commented on September 26, 2024

Also having this issue with AirbnbRating (ver. ^4.0.0-rc.8)

from react-native-elements.

YGBReda avatar YGBReda commented on September 26, 2024

same issue here : import {Dialog} from '@rneui/themed';

Warning: Dialog.Button: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.

from react-native-elements.

Luke-lsm avatar Luke-lsm commented on September 26, 2024

Hello all, I have a workaround for this problem - not a solution! But works while we wait, by applying a patch to the rneui library you can eliminate the warning. I had a warning regarding defaultProps on the Slider component as some of you have had - however this workaround should work for any similar components.

If you are using yarn in your project its a relatively easy workaround, you can run
yarn patch @rneui/base

This will create & output a temporary directory where you can work on the file/files in question that are causing you trouble. For me this was converting the slider's default props to use parameters in the functions signature itself.

Once you have made your patch and removed the use of defaultProps, yarn will have output a command you need to run to reintroduce the patch to your package, it'll look something like:
yarn patch-commit -s {temp directory location}

Then remember to commit this patch to your version control and make sure a .gitignore isn't blocking the .yarn/patches folder.

If you're not using yarn, you can use https://www.npmjs.com/package/patch-package to do the same process.

Those of you with the Dialog issue, it looks like you'll want to look in the temp created folder at dist/Dialog/Dialog.Button.js at line 21 and convert the default props.

Not perfect I'm aware but it eliminates warnings and doesn't take too long to sort out. Hope this helps! 👍

Code for the Slider changes: https://gist.github.com/Luke-lsm/ac25bc6d4b5cc75734cca2caf3a8d02e

from react-native-elements.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.