What component to use as root of child component?
See original GitHub issuenative-base v2.1.5
In RN components or loops, all content must be wrapped in a single component. If it’s not the top-level component then previous to Native Base we’d use a <View>
tag.
E.g. this is ok:
render() {
<View>
<Text />
<Text />
</View>
}
But this breaks:
render() {
<Text />
<Text />
}
With what do we replace <View>
in this case? Container
gives strange behavior (I believe it should only be at the top level of the screen) and Content
is supposed to be only one per screen. Is continuing to use <View>
as the top level of child components the recommended method?
Couldn’t find anything about this in the docs.
Thank you!
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Programming CM - Root and child components - IBM
A root component is the first or only level of an l item type. An item type consists of both system- and user-defined...
Read more >How to inject a component into root component from a child ...
But i want to inject ToastrNotification to the root element from MyComponent using a code like below: const showNotification = () => { ......
Read more >Vue.js Components — Parent, Child and Root - Medium
In this article, we'll look at how to access various parts of a parent, child, or root component. Also, we look at dependency...
Read more >An Introduction to Child-Root Data Passing in React.js
In this guide, you will explore this use case in React.js. ... It's the same when passing data from a parent to child...
Read more >Components Basics - Vue.js
To use a child component, we need to import it in the parent component. Assuming we placed our counter component inside a file...
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
@lukecwilliams
Container
component of NativeBase is actually View component of RN and ScrollView is the replacing component of Content. For any screen the ideal code structure with NativeBase is something like this http://docs.nativebase.io/Components.html#anatomy-headref Use Content inside Container, if you have a scrollable View else you can just use Container. Hope that makes sense. Le us know if you face any issue@lukecwilliams ok