1

I use react-tabs (https://reactcommunity.org/react-tabs/) to create 4 tabs. Now I need to create routes like this "https://example.com/page=01#tab1", "https://example.com/page=01#tab2" for them. They open page with choosen tab when you click on tab name.

I tried to replace react-tabs with few <Link to="#tab1>Tab1</Link> and <Route path='#tab1' render={() => <MyComponent store={store}/>}/> from react-router-dom, but tabs aren't switched.

IleksaNott
  • 11
  • 2

1 Answers1

0

Okay, I found only one solution: I use window.location.hash to set and get hashlink value. Also I add callback onMouseDown to tab names to imitate router: I change window.location.href in this callback.

IleksaNott
  • 11
  • 2