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.

React-native: warning Node of type rule not supported as an inline style

See original GitHub issue

Hey, when I tried to use the below styling in react-native:

const Input = styled.input`
  font-size: 1.25em;
  padding: 0.5em;
  margin: 0.5em;
  color: palevioletred;
  background: papayawhip;
  border: none;
  border-radius: 3px;

  &:hover {
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.1);
  }
`;

I go the the title warning, which I do not know how to resolve it. If I delete the internal hover section, it works without warning.

Thanks

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:16
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

44reactions
kittencommented, May 6, 2017

You have to use the native import and a native component.

https://sc-next-docs.philpl.com/docs/basics#react-native

12reactions
bernatfortetcommented, Jun 1, 2017

I just found the problem 😕

height: {p => p.inputHeight}px; instead of height: ${p => p.inputHeight}px; I was missing the $ before the brackets

I wonder if there’s a good way to alert for that.

Thanks anyway

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pseudo selectors not working with styled-components - Reddit
I'm using styled-components library with react native. pseudo selectors after, ... "node of type rule not supported as an inline style".
Read more >
Styled-system in react native responsive values - Stack Overflow
I want to use responsive style in my box component but I get error "Node of type atrule not supported as an inline...
Read more >
React Styled Components: Inline Styles + 3 Other CSS Styling ...
There are four different ways to style React application, and in this post you will learn about them all. Let's start with inline...
Read more >
FAQs - styled-components
The repeated class bumps the specificity high enough to override the source order without being very tedious to write! How can I override...
Read more >
Why you shouldn't use inline styling in production React apps
One of the main reasons that inline styling is not a good choice for your application is because it does not support (or...
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