1

Im trying to build a mobile app where we have a constant header bar throughout the app. I have the body where I have buttons.. Each button navigates to a screen. I need the header bar in every screen but I dont wish to repeat the code in all screens. I dont intend to use TabNavigator either. Is there any alternative??

image 1 image 2

in image1 and image 2 the bar with the search,cart and offerzone tag remains same. The rest changes..I need this behaviour without repeating the header code in both screens.

subha
  • 426
  • 1
  • 3
  • 14

1 Answers1

0

You can separate the code of headerBar into a independent component, and use redux store to manage this component's props.

After you do this, you just need to import the component in each screen, the component will get its props from redux store automatically. Each screen can contact headerBar with redux actions

Harlan
  • 847
  • 5
  • 15
  • 1
    No I don't want to import the component in each screen. I would prefer something like frames in HTML where 2 frames are independent of each other. – subha Aug 24 '17 at 05:48