What is the proper way to initialize state when using typescript and react. The following throws an error because obviously currentVehicle isn't allowed to be an empty object. What should the initial state be? What are best practicies?
interface State{
currentVehicle:Vehicle
}
export default class extends Component<Props, State> {
state:State={
currentVehicle:{}
}
}
Stateinterface to the React.Component you should just initialize it likestate = { currentVehicle: {} }