I want to replace some part of screen with another screen in React Native

Viewed 260

I want to toggle between completed and upcoming screen without reloading full screen just want to change the section under the button, refer image for understanding. Completed

Upcoming

1 Answers

You can simply use TabNavigation from react-navigation package you can check here. Also, you can change a part of a screen using a state in that screen something like this:

const Screen = () => {
  const [completed, setCompleted] = useState(true)

  return (
    ...
    { completed ? <Completed /> : <Upcoming /> }
    ...
  )
}

I hope you got the idea :)

Related