i begin telling you that this code work, bu i can not find documentation about the use of code inside {}. The useStore is only a hooks in react
//React ES6+ Typescript
const MyComp= (props: MyCompProps) => {
let state1 = null;
let action1 = null;
{
const {state, actions} = useStore1(mapState1,FnActions1);
state1 = state;
action1 = actions;
}
let state2 = null;
let action2 = null;
{
const {state, actions} = useStore2(mapState2,FnActions2);
state2 = state;
action2 = actions;
}
.....
}
in orginal my code was:
const {state1, action1} = useStore1(mapState1,FnActions1);
const {state2 , action2 } = useStore2(mapState2,FnActions2);
but typescript noted me a error Error:(57, 26) TS2459: Type 'StoreProps<{ error: any; loading: any; isFetching: any; } Pr...' has no property 'actions' and no string index signature. but using the first pasted code, work fine. But why?where i can find documentation about this use of code inside {...} ?