【发布时间】:2022-12-04 11:34:30
【问题描述】:
How to pass state values to the child component(CreateUser)
In CreateUser, I am trying to collect as props.data but getting \"undefined\"
const One = (props) => { const [info1, setInfo1] = useState({ firstname: \"\", lastname: \"\", email: \"\", mobnumber: \"\", password: \"\", }); //.... return ( <div> <div className=\"container\"> <div className=\"row \"> <div className=\"col-4\"> <CreateUser onInputChanged={onInputChanged} data={props.info1} ></CreateUser> </div> <div className=\"col\"> <SelectParker /> <br /> <ActionButtons {...props} nextStep={validate} /> </div> </div> </div> </div> );
// In CreateUser, I am trying to collect as props.data but getting \"undefined\"
标签: reactjs
data={info1}.info1is a state not props.