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.

Props shows up as attributes

See original GitHub issue

Styled System Props ends up as attributes of DOM elements

is this an intended behaviour ?

even code sandbox link below has the same issue

<h1 font-size="4,5,6" font-weight="bold" class="sc-bdVaJa sc-htpNat sc-bxivhb cNddNq">Hello, Rebass</h1>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
ckeeneycommented, Feb 20, 2019

@jxnblk What is your recommended way of solving this? I understand the motivation of pushing the responsibility of cleaning props from DOM to a lower-level library, but all the workarounds I see would have to be implemented in Rebass, not my code. Is it possible to use rebass and not have props rendered to DOM right now?

2reactions
jxnblkcommented, Feb 8, 2019

See styled-components/styled-components#439

Read more comments on GitHub >

github_iconTop Results From Across the Web

How React Props relate to HTML attributes and JS functions
In React, “props” is a mix of the two mental models above: HTML attributes and function parameters. When rendering a React component on...
Read more >
Why are Styled Component props displaying as HTML ...
Basically if you use a non-camelcase prop to do styling, it'll get passed through to the DOM node. We're looking into better alternatives...
Read more >
Render Props - React
And remember, the children prop doesn't actually need to be named in the list of “attributes” in your JSX element.
Read more >
React Props Cheatsheet: 10 Patterns You Should Know
Props are a powerful tool to use in React, but how do you use them effectively to write robust, reliable React components and...
Read more >
Displaying Data with Props - From JavaScript to React - Next.js
Regular HTML elements have attributes that you can use to pass pieces of information that change the behavior of those elements. For example,...
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