From 6074240262b730ba6f43d43981b312b389a5fc46 Mon Sep 17 00:00:00 2001 From: Asjid Ali <asjidale@gmail.com> Date: Sun, 1 Dec 2024 22:34:05 +0500 Subject: [PATCH] Fix: issue 128 Replace `defaultProps` with JavaScript default parameters 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. --- src/index.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/index.js b/src/index.js index 022bca6..18ffd54 100644 --- a/src/index.js +++ b/src/index.js @@ -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 } @@ -268,9 +268,3 @@ if (process.env.NODE_ENV !== 'production') { transitions: PropTypes.string, }; } - -Step.defaultProps = { - children: [], - isActive: false, - transitions: '', -};