I want to setState in a static function. But I got an error which says setState is not a function:
export default class SearchTab extends React.Component {
constructor(props) {
super(props);
this.state = {
name: ''
}
}
static callingFun = () => {
this.setState({ name:'ali' })
}
}