this.setState({buildingName: building.name})
I am trying to pass value to the state but getting this error:
Argument of type '{ buildingName: string; }' is not assignable to parameter of type 'MoveInFormState | ((prevState: Readonly, props: Readonly) => MoveInFormState | Pick<MoveInFormState, "buildingName"> | null) | Pick<...> | null'. Type '{ buildingName: string; }' is not assignable to type 'Pick<MoveInFormState, "buildingName">'. Types of property 'buildingName' are incompatible. Type 'string' is not assignable to type '{ [key: string]: string; }'.
type MoveInForm = Pick<
Types.Form.IFormData,
"submitted" | "apartmentId" | "id" | "status" | "applicants"
>;
interface MoveInFormState {
buildingName: {[key: string]: string}
}
this.state = {
buildingName: {}
};