componentDidMount(){
axios.get('/sites/multiscreen/templates').then(res => {
if(res.data.template_id.match(/^[a-z0-9]+$/i)){
this.setState({
templates: res.data,
});
}
})
}
The error I'm getting is this:
Unhandled Rejection (TypeError): Cannot read property 'match' of undefined
Any help is appreciated!
template_idisn't a string.res.data? Error is saying thatres.data.template_idis undefined.