1

I am using react native 0.64, I want to load my profile screen from home screen without using navigation. Is it possible? Can anyone help?

2
  • import profile screen in home screen and then use the profile component like this => <Profile /> Commented Sep 18, 2022 at 6:48
  • isn't it for component? I want to stay at the home screen. But want to render the profile screen from home. But the way you prescribed will show the profile component in the home page which I don't want to show Commented Sep 18, 2022 at 6:54

1 Answer 1

0

You should use a state for represent home or profile. for ex:

 function HomeScreen() { const [screenName, setScreenName] = useState('home') if (screenName == 'profile') { return <ProfileScreen/> } return { ... // handling the event to go Profile screen setScreenName('profile') ... } } 
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for replying. But That's not What I wanted. I have a screen called speedtest screen which load okla custom speedtest webview, basically, it takes a much longer time to load. So, I wanted to load speedtest screen as soon as user logged in(without navigating) user will stay at home screen.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.