Closed Volodymyr128 closed 9 years ago
The issue here appears to be the way you are mixing in default props and expecting them to be maintained. When you call super(_.assign(props, customizations));
this is a one-time assignment. Every time your component is rendered these props are not passed down from the parent and so they are unavailable to your component.
You have two options to fix:
Use defaultProps:
Step1.defaultProps = {
stepNo: 1,
progress: '1/3',
title: 'some title'
};
module.exports = validation(strategy)(Step1);
Or actually pass these variables from the parent:
<Step1 stepNo={1} progress={'1/3'} title={'some title'} />
Thanks!!!!!
I'm using react + es6, so to pass props of Step1 component I need to pass them as
super(props)
atconstructor
.Step1
is route-handler (I use react-router) so it's the only way to pass props in it. The problem is that I miss all my custom properties onthis.props.validate()
. Look at the example below please (pay attention to_onChange
& 'render' method comments).