Skip to content

How to fix the React console error regarding an unknown prop being sent through to the DOM #699

Discussion options

You must be logged in to vote

Hey,
You are using Props for styling, but you dont use it for anything else. React recognize this and hints you, that this is maybe not intentionally.

and thats true - its not ;)
styled-components has a solution for this.

here is an example we discussed in the session:

return (
  <>
    <Container>
      <Button>Click me</Button>
      <Button $color="danger">Click me not</Button>
    </Container>
    {/* ... */}
  </>
);

These sol called Transient props are not forwarded to the underlying DOM node and Recat will be happy :)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by NirachaMarchett
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Web
Labels
None yet
2 participants