Note that React accept a RefCallback<T> instead of a RefObject<T>, that may be used with a state instead of reference, that would trigger a rerender.
Note that React accept a `RefCallback<T>` instead of a `RefObject<T>`, that may be used with a state instead of reference, that would trigger a rerender.
maxime.batista marked this conversation as resolved
```diff
-export enum VisualizerStateActionKind {
+export const enum VisualizerStateActionKind {
```
Those enums may be inlined as numbers, without `const` it would [generate a object to map at runtime ](https://www.typescriptlang.org/play?#code/KYOwrgtgBAaglgZzAQwDZwF7AE4GUAuy+wAggMb5wD2IA0nCACZQDeAUFJ1AJIBy3AFQA0HLrgCiAgPoBhAPK8B4xbhEBfIA)strings to int.
maxime.batista marked this conversation as resolved
//force update once the court reference is set
useEffect(() => {
setCourt(courtRef.current)
Note that React accept a
RefCallback<T>
instead of aRefObject<T>
, that may be used with a state instead of reference, that would trigger a rerender.<PlainCourt className="court-image" />
) : (
<HalfCourt className="court-image" />
)}
parentContent: StepContent | null
}
export enum VisualizerStateActionKind {
Those enums may be inlined as numbers, without
const
it would generate a object to map at runtime strings to int.stepId: number
}
export function visualizerStateReducer(
Expose the already configured reducer preferably.
2e1efeeb25
tof9e436ea12
1 year ago3da28f828d
into master 1 year agoReviewers
3da28f828d
.