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.

Problem with utilizing props

See original GitHub issue

Version

1.4.5

Reproduction

parent.js

  <FloatingMenu background="red">
         {...}
   </FloatingMenu>

child.js

const Container = styled.ul`
  background: ${props => props.background}
  }
`;

The props.background simply not working at all.

Steps to reproduce

git clone https://github.com/ifndefdeadmau5/react-floating-button-menu npm install npm start

Expected Behavior

The props inside of template literal has to hold received props

Actual Behavior

Got undefined except boolean props. Also, the style doesn’t change whenever props that determines it’s style is changed

Issue Analytics

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

github_iconTop GitHub Comments

18reactions
ifndefdeadmau5commented, Apr 23, 2017

I struggled almost 4 hours like ‘why this simple feature doesn’t work’ and finally decide to report a bug and totally don’t regret it!! Thank you so much

5reactions
k15acommented, Apr 23, 2017

Unfortunately we can’t do any magic and you still have to pass your props around like you do in React.

Read more comments on GitHub >

github_iconTop Results From Across the Web

props in presentations: 4 benefits, 3 problems
Some audiences will react negatively. Use your judgement and common sense. My personal advice is to use props that are the minimum to...
Read more >
5 Props Challenges and How to Overcome Them
1. Dealing with a huge list of props · 2. Difficulty working with props · 3. Consumable props · 4. Broken props ·...
Read more >
Unknown Prop Warning
The unknown-prop warning will fire if you attempt to render a DOM element with a prop that is not recognized by React as...
Read more >
How To Avoid Prop Drilling in React Using Component ...
Prop drilling is similar: You pass data (props) from some FirstComponent to another SecondComponent - which doesn't need the data to render but ......
Read more >
Using Props to Initialize State of Component
This implies that the state of the component is tied to the props of the component. The issue with doing this is that...
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