ore-ui
ore-ui copied to clipboard
Suppress twoslash implicit type error on hook examples
The error annotation for the twoslash code blocks on the useFacetState and useFacetCallback produce a visual error on the markdown in the documentation, warning of an implicit any type.
Whether this was intentional or not, I believe the TypeScript is correct enough to not warrant a drastic change of an example, since it doesn't cause a compiling error in React, but if such an annotation was intended, I do apologize for the misplacement.
The solution to fix this error without requiring the suppression of the error annotation would be to declare the type within the useCallback React function:
const handleChange = useCallback(
- (event) => {
+ (event: any) => {
setValue((event.target as HTMLInputElement).value)
},
[setValue],
)
This, of course, is a change to the documentation itself, and I felt was not necessary. Any changes and such are welcome of course, just figured I'd help!
Take care.