Components inside components
See original GitHub issueThis is a thread dedicated to discussing how we should compose components in the library / how we should encourage library users to do the same.
Case study: ButtonGroup
component.
Inspiration: https://www.futurelearn.com/pattern-library.
Expanding here in more detail soon…
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
React.js How to render component inside component?
React will only render the top-level custom components PageTop and PageBottom , as you already found out. The other components ( TopPlayers and ......
Read more >React: Create component inside a component (?)
React: Create component inside a component (?) Here, the 'Users' component is re-rendering whole list whenever the search string changes. This ...
Read more >Code Review: Avoid Declaring React Component Inside ...
Using uncontrolled components, access values of inputs via ref. After checking his code, I found that everything is fine, except for one major ......
Read more >How to embed two components in one ... - GeeksforGeeks
React allows us to render one component inside another component. It means, we can create the parent-child relationship between the 2 or ...
Read more >Components and Props - React
Components can refer to other components in their output. This lets us use the same component abstraction for any level of detail. A...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Looking at all the conversations we have had so far, it seems that we’re starting to agree on the following (adding my own thoughts here and there, but we should discuss all of this):
<Tabs><Tab></Tab></Tabs>
instead of<Tabs tabItems={[item1Data, item2Data]} />
. UseReact.Children.map
and purchase several muffins for @Angarsk8.glamorous
components instead). Sometimes this is necessary, and that’s ok, just use the prefix ‘co_’.ButtonGroup
does. In this case, we can add a class name likeco_bgel
to the children in the render method of the parent (see https://codepen.io/peterszerzo/pen/VMXQKO?editors=1010), and override using said class name. Class names prefixed byco_
will not cause styling conflicts with each other as they are all scoped, so we can keep them short and snappy.Me too, I think it’s the best way to go. I suggest prefixing them with
co_
or something.