question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

0.5.0-alpha.1 - Property 'sx' does not exist on type 'IntrinsicAttributes & ...

See original GitHub issue

Since upgrading 0.5.0-alpha.1, I see this error on external(non-theme-ui) components

Property 'sx' does not exist on type 'IntrinsicAttributes & ...

example:

https://github.com/ccontrols/component-controls/blob/0335fb94440b8dc67a4b00c7db0560a2f42947aa/ui/components/src/CopyContainer/CopyContainer.tsx#L30

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
hasparuscommented, Nov 29, 2020
import {} from 'react'
import { ThemeUIStyleObject } from 'theme-ui'

declare module 'react' {
  interface Attributes {
    sx?: ThemeUIStyleObject
  }
}

I’m wondering if we should add a snippet above in one easy to import file to allow users to opt-in to global sx prop with a one-liner. @atanasster @dcastil, what do you think?

1reaction
atanasstercommented, Nov 30, 2020

just a note, I was unable to quickly move to the new sx props as more issues came about - before this change even if a component did not declare a sx prop, it was automagically applied.

For now, I am re-declaring the global sx and was able to upgrade and give more testing to 0.5.0 in the coming days. I will try to also track down one by one the issues to eventually remove the global sx.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error not recognizing properties in react: position, sx
You're importing from @material-ui/lab which is the package that contains v4 of the components (which do not contain the sx or position ...
Read more >
The sx prop - MUI System
The sx prop is a shortcut for defining custom styles that has access to the theme. The sx prop lets you work with...
Read more >
@material-ui/types | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
material-ui/core/CHANGELOG.md - UNPKG
This is a reminder that all ongoing work has moved to v5. This means a feature freeze on v4. The development of v4...
Read more >
The `sx` Prop - Theme UI
The following CSS properties will use values defined in the theme, when available. Property, Theme Key. fontFamily, fonts. fontSize, fontSizes.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found