-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to wrap my topmost component (App) in a Native Base Root component with v1 RNN ? #4640
Comments
Hi @msqar, this simply isn't possible with |
@rawrmaan Yes, you're right. I ended up using If anyone is under the same situation, here's the solution. When in the spec says it requires to wrap the topmost component, is not necessarily the So, if in the render function of a component you have something like this, you can still add the Root on top of eeeevery component there and it will work like a charm :) this solution was brought by someone on Native-Base github. Kudos to him.
|
@msqar You just saved my day. |
Glad it worked for you man :) that was the intention, to help others, although i ended up using a different library. I found that too late. But i'm happy it helped you at least! |
Hi just to confirm @msqar , do i have to import Root from native base like this |
I'm using React-Native-Navigation v1 with Native Base. Wanted to add their ActionSheet component but as a requirement, it says i need to wrap the topmost component inside their Root component.
But i can't seem to find a way to do it, any suggestion?
The way i'm initializing the app is first registering every screen like this:
Navigation.registerComponent('app.ChatScreen', () => ChatScreen, store, Provider);
Then calling for the login:
I read there was an issue kinda related to this one, where someone suggested creating a wrap function:
And then wrapping it inside the same register:
Navigation.registerComponent('app.ChatScreen', () => wrap(ChatScreen), store, Provider);
But it doesn't work, it throws: "Can't find variable
React
" whenever the tabBasedApp starts.Any ideas? Thanks.
Environment
The text was updated successfully, but these errors were encountered: