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

Warning: Dialog.Loading: Support for defaultProps will be removed from function components in a future major release. #3907

Open
1 task done
vijaychouhan-rails opened this issue May 18, 2024 · 7 comments

Comments

@vijaychouhan-rails
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Explain what you did

I have used

import {Dialog} from '@rneui/themed';

and Used in component

<Dialog.Loading loadingProps={mainStyle.v2SbSixthTxtColor} />

In react native verion 0.74.1

Its throwing an warning

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

Expected behavior

It should not throw that warning, remvoe defaultProps as its not deprecated and will be removed in next react native version

Describe the bug

I have used

import {Dialog} from '@rneui/themed';

and Used in component

<Dialog.Loading loadingProps={mainStyle.v2SbSixthTxtColor} />

In react native verion 0.74.1

Its throwing an warning

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

Steps To Reproduce

import {Dialog} from '@rneui/themed';

const FixLoader = props => {
  return (
    <Dialog overlayStyle={mainStyle.transparent} isVisible={loading}>
)
}

Screenshots

WhatsApp Image 2024-05-18 at 5 43 41 PM

Your Environment

`npx @rneui/envinfo`
  ```
    Output from `npx @rneui/envinfo` goes here.
    React Native Elements Env Info

 ## Global Dependencies:

No related dependency found

Local Dependencies:

  • @rneui/base : ^4.0.0-rc.8
  • @rneui/themed : ^4.0.0-rc.8
  • react : ^18.2.0
  • react-native : 0.74.1
  • @types/react : ^18.2.67
    
    
@rob-pathway
Copy link

rob-pathway commented May 23, 2024

Also having this issue with <Slider />

@helloitsmix
Copy link

Have the same warning

@vaniapsk
Copy link

vaniapsk commented May 26, 2024

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

@antoniovuono
Copy link

Same problem here with <Dialog.Loading />

@Emauss
Copy link

Emauss commented Jun 3, 2024

Same issue in <CheckBox />
But with TextElement:

"Use JavaScript default parameters instead. %s TextElement"

@acmasters17
Copy link

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 😢

@joesingtecs
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants