Skip to content
New issue

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

Typescript error when using sx prop in a Box component #1109

Closed
danielmariz opened this issue Jun 2, 2021 · 2 comments
Closed

Typescript error when using sx prop in a Box component #1109

danielmariz opened this issue Jun 2, 2021 · 2 comments

Comments

@danielmariz
Copy link

Hi there,
I've installed only the reflexbox and its types to use Box and Flex only, the problem I'm getting is that box does not implement shadow from styled system on its composition so I'm assuming the only way to get those props is via sx prop.
But I'm getting this typescript error when trying to do that
Property 'sx' does not exist on type 'IntrinsicAttributes & ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & Omit<...> & { ...; }'.ts(2322)

<Box as='form' onSubmit={submitHandler} sx={{borderRadius: '24px', boxShadow: 10, p: '24px'}} >

How can I get around it?

Cheers

@kevzzsk
Copy link

kevzzsk commented Jul 20, 2022

Hey, I am facing this same issue. How did you solve it?

I have installed reflexbox and unable to use sx prop with typescript

@danielmariz
Copy link
Author

@kevzzsk I'm not using this package was just an experiment I don't think I was able to get around it at that time. I started using styled-system together with styled component and created my own ui components.
Sorry not being able to help that much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants