We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I was wondering if there is a way to allow our users to write examples with Typescript inside of Playroom?
We have this component that we export to our users for some more complex examples:
export const FunctionWrapper = ({ children }) => children();
Then, it is used via and works for the majority of our use cases.
<FunctionWrapper> {() => { const [state, setState] = React.useState(123); return <div>{state}</div>; }} </FunctionWrapper>
We have some spots where we want to show the proper Typescript approach for our more complex examples, but we can't get it to work. Any suggestions?
Something like this:
<FunctionWrapper> {() => { const [state, setState] = React.useState<number>123; const onClick = (event: MouseEvent) => { console.log("click"); }; return <div>{state}</div>; }} </FunctionWrapper>
The text was updated successfully, but these errors were encountered:
hope you find an answer to your question, but wanted to say thank you for sharing that FunctionWrapper component, really handy!
FunctionWrapper
Sorry, something went wrong.
No branches or pull requests
I was wondering if there is a way to allow our users to write examples with Typescript inside of Playroom?
We have this component that we export to our users for some more complex examples:
Then, it is used via and works for the majority of our use cases.
We have some spots where we want to show the proper Typescript approach for our more complex examples, but we can't get it to work. Any suggestions?
Something like this:
The text was updated successfully, but these errors were encountered: