When the component renders it has some children components and when i log props in the formgroup it looks like what's below. {$$typeof: Symbol(react.element), key: null, ref: null, props: {…}, type: ƒ, …}
import React from 'react';
class FormGroup extends React.Component {
constructor(props) {
super(props)
this.state = {
value: {}
}
}
setValue() {
//do nothing at the moment
}
render() {
return (<div className="formGroup" >
{
this.props.children.map(child => {
child.props.setValue = this.setValue;
console.log('child', child)
// does not change
return child;
})
}
</div>)
}
};
export default FormGroup;