Skip to content

Commit

Permalink
fix: fix console warning regarding undefined required prop
Browse files Browse the repository at this point in the history
During transition between scenarios with different run templates, the default
value for a given scenario parameter may temporarily not be available. This leads
to console warnings because the defaultParameterValue prop was decalred as required.
Yet, it does not need to be required: the component could use null or undefined as a
default value, or wait for the actual default value to be retrieved during
transitions between scenarios.
  • Loading branch information
csm-thu committed Apr 27, 2023
1 parent d65597f commit 2c4330d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ GenericNumberInput.propTypes = {
context: PropTypes.object.isRequired,
parameterValue: PropTypes.any,
setParameterValue: PropTypes.func.isRequired,
defaultParameterValue: PropTypes.number.isRequired,
defaultParameterValue: PropTypes.number,
isDirty: PropTypes.bool,
};

GenericNumberInput.defaultProps = {
isDirty: false,
};

0 comments on commit 2c4330d

Please sign in to comment.