-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Closed
Description
Hi @sudheerj
in Q11, u wrote
Note: The only place you can directly assign to the state object is in constructor.
but u can remove the constructor from the component and access the state object
class Hello extends Component {
state= {
a:"hello",
b:" react"
}
render(){
const {a,b} = this.state;
return(
<div>{a + b}</div>
)
}
}
sudheerj and csjihe
Metadata
Metadata
Assignees
Labels
No labels