Skip to content

Commit

Permalink
Fix: issue 128 Replace defaultProps with JavaScript default paramet…
Browse files Browse the repository at this point in the history
…ers for functional components

This PR addresses the deprecation warning related to the use of defaultProps in functional components, as seen in the warning message pointed in issue# 128:

Warning: y: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
  • Loading branch information
AsjidAle authored Dec 1, 2024
1 parent eeec405 commit 6074240
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ StepWizard.defaultProps = {
};

export const Step = ({
children,
isActive,
transitions,
children = [],
isActive = false,
transitions = '',
}) => (
<div className={`${styles.step} ${transitions} ${isActive ? styles.active : ''}`.trim()}>
{ children }
Expand All @@ -268,9 +268,3 @@ if (process.env.NODE_ENV !== 'production') {
transitions: PropTypes.string,
};
}

Step.defaultProps = {
children: [],
isActive: false,
transitions: '',
};

0 comments on commit 6074240

Please sign in to comment.