Im new to reactjs. I dont really understand how does props and state work. From my research i have found that props are passed from parent to child. And states can only be used in a single component. But when i see these codes below, i have no idea how it works. Can someone provide me with a good example and explanation. Thanks
Not only that whats the difference between let and var
default class WildList extends React.Component {
constructor(props){
super(props);
this.props = props;
let {keyword, dealstatus} = this.props;
this.state = {
keyword
}
}
}
PS = This WildList class is being used in different component as well.