You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am trying to make a Component that will disable the ability for my ResizableBox to be resized on the x-axis depending on its state. The state checks if a boolean is true or false. If true, the axis is set to "x". If false, the axis is set to "none". When I give the axis prop to ResizableBox, I get a Typescript error that reads as the following: Type '"none"' is not assignable to type '"both" | "x" | "y" | undefined'.
It seems there is an exported type AxisType in react-resizable that should dictate which types can be given to axis and includes type "none". When I locally run my Component while still giving axis the type "none", it works as intended (i.e. the Component is not resizable). If I give the axis type undefined, it breaks the Component and allows it to be resizable. Is this intentional?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, I am trying to make a Component that will disable the ability for my ResizableBox to be resized on the x-axis depending on its state. The state checks if a boolean is true or false. If true, the axis is set to "x". If false, the axis is set to "none". When I give the axis prop to ResizableBox, I get a Typescript error that reads as the following:
Type '"none"' is not assignable to type '"both" | "x" | "y" | undefined'.
It seems there is an exported type
AxisType
in react-resizable that should dictate which types can be given to axis and includes type "none". When I locally run my Component while still giving axis the type "none", it works as intended (i.e. the Component is not resizable). If I give the axis type undefined, it breaks the Component and allows it to be resizable. Is this intentional?Beta Was this translation helpful? Give feedback.
All reactions