MaterialTopTabNavigator - Issue with navigation

So, I used topTabNavigator to create 2 tabs A and B which renders the same component. So now, when I click the first tab A it renders my component correctly now I click B it renders it correctly again but now when I click tab A again it renders all the information of Tab B. Tab B is being placed on top of Tab A and when I click anything on Tab A the effect is seen on Tab B but not on tab A.