Answer the question
In order to leave comments, you need to log in
Like a setState button on an element that will change the state of the element one level up?
There is such an application
import { UserFirstForm } from './UserFirstForm'; Здесь декларировать передачу стейта?
import { UserHome } from './UserHome';
import....
class GridView extends Component {
constructor(...args) {
super(...args);
this.state = {
form: <UserFirstForm/> или Здесь декларировать передачу стейта?
};
}
render() {
return (
<div>
{this.state.form}
<Button onClick={() => this.setState({ form: <NewPatient/> })} ></Button>
</div>
);
}
}
export class App extends Component {
render() {
return (
<GridView/>
);
}
}
<UserFirstForm/> <UserFirstForm />
others, so that they change the state in the parent. How should the declaration of a parameter look like so that the state takes the value children?export class UserHome extends Component {
constructor(...args) {
super(...args);
this.state = {
Как задекларировать стейт? : что то принимает за значение....
};
}
render() {
return (
<div>
<ButtonGroup justified>
<Button onClick={????} >Patient<br/>Service</Button>
<Button onClick={????} >Non-patient<br/>Service</Button>
<Button onClick={????} >Engagement</Button>
</ButtonGroup>
</div>
);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question