You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using react-native-pell-rich-editor, the following warning is displayed in the console during development:
Warning: bound renderChildren: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
This warning indicates that defaultProps is being used in one or more functional components within the library, which is deprecated in newer versions of React.
Steps to Reproduce
Install and set up the latest version of react-native-pell-rich-editor.
Add a RichEditor or RichToolbar component to your project.
Run the app in development mode.
Observe the warning in the console.
Expected Behavior
No warnings should appear related to defaultProps.
Actual Behavior
The console shows the deprecation warning.
Environment
Library Version: 1.9.0
React Version:18.3.1
React Native Version:0.76.3
Platform: (both)
Proposed Solution
Replace the use of defaultProps in functional components with default values using JavaScript default parameters.
Example:
jsx
Copy code
// Before
const MyComponent: React.FC<{ title?: string }> = ({ title }) => {
return {title};
};
// After
const MyComponent: React.FC<{ title?: string }> = ({ title = 'Default Title' }) => {
return {title};
};
This change ensures compatibility with the current and future versions of React, where defaultProps for functional components will no longer be supported.
Additional Notes
This warning may not currently affect functionality but will become an issue in future React versions.
Thank you for maintaining this library and considering this request!
The text was updated successfully, but these errors were encountered:
When using react-native-pell-rich-editor, the following warning is displayed in the console during development:
Warning: bound renderChildren: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
This warning indicates that defaultProps is being used in one or more functional components within the library, which is deprecated in newer versions of React.
Steps to Reproduce
Install and set up the latest version of react-native-pell-rich-editor.
Add a RichEditor or RichToolbar component to your project.
Run the app in development mode.
Observe the warning in the console.
Expected Behavior
No warnings should appear related to defaultProps.
Actual Behavior
The console shows the deprecation warning.
Environment
Library Version: 1.9.0
React Version:18.3.1
React Native Version:0.76.3
Platform: (both)
Proposed Solution
Replace the use of defaultProps in functional components with default values using JavaScript default parameters.
Example:
jsx
Copy code
// Before
const MyComponent: React.FC<{ title?: string }> = ({ title }) => {
return {title};
};
MyComponent.defaultProps = {
title: 'Default Title',
};
// After
const MyComponent: React.FC<{ title?: string }> = ({ title = 'Default Title' }) => {
return {title};
};
This change ensures compatibility with the current and future versions of React, where defaultProps for functional components will no longer be supported.
Additional Notes
This warning may not currently affect functionality but will become an issue in future React versions.
Thank you for maintaining this library and considering this request!
The text was updated successfully, but these errors were encountered: