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 have an issue adding additional props for the input, for example when trying to bind ref prop to the component
##Screenshots
To Reproduce 馃暪
Just try to attach a ref prop to the Input component
Context 馃敠
I'm using react-rainbow in a type-safe system (typescript) with react-hook-form and apparently ref is not allowed on the Input props so I can't bind their hooks with your component.
Suggestion
I think a quick fix would be to add an optional property to the BaseProps interface
Hi @goodbeysr, you are right we need to define the ref type in the typescript declaration file of the component.
I think we should use a more specific type like MutableRefObject which is what React.useRef returns or a more generic Ref<any>.
I will make a PR request fixing this for the Input, we need to also make this for other components.
Thank you for the feedback and it is great that you are using react-rainbow.
Hello, I have an issue adding additional props for the input, for example when trying to bind ref prop to the component
##Screenshots
To Reproduce 馃暪
Just try to attach a ref prop to the Input component
Context 馃敠
I'm using react-rainbow in a type-safe system (typescript) with react-hook-form and apparently ref is not allowed on the Input props so I can't bind their hooks with your component.
Suggestion
I think a quick fix would be to add an optional property to the BaseProps interface
interface BaseProps {
className?: string;
style?: CSSProperties;
ref?: any;
}
Or a more sophisticated :
interface BaseProps {
className?: string;
style?: CSSProperties;
ref?: T;
}
The text was updated successfully, but these errors were encountered: