Topic: stop tabs from refreshing

Manamapps free asked 4 years ago


Expected behavior no refreshing of page Actual behavior page allways refresshes on first click of tab

<MDBNavItem>
        <MDBNavLink link to="#" active={activeItemClassicTabs3==="2"} onClick={() => toggleClassicTabs3("2")}>
          <MDBIcon icon="users" size="1x" />
          <br />
          Processes
        </MDBNavLink>
      </MDBNavItem>

Resources (screenshots, code snippets etc.)


Manamapps free answered 4 years ago


thats not the issue. its not refreshing but rerendering the outer component that fetched all the data. it's a big project. shall i send you the the code?


Jakub Chmura staff commented 4 years ago

If you send me the code, it will be easier to find a solution.


Manamapps free commented 4 years ago

sorry for the late response. shall i send you the whole git?


Jakub Chmura staff commented 4 years ago

If you think it will be easier to solve the problem then you can send it. As you say, if this is a large project, it seems to be easier to solve the problem this way.


Jakub Chmura staff answered 4 years ago


Hi @Manamapps,

Delete prop link from MDBNavLink.

MDBNavLink is a NavLink from react-router-dom. When you add link prop to MDBNavLink you change this component to just Link from react-router-dom.

Since a few versions of MDBReact, you can use just MDBLink to have a just Link from the router.

Please tell me if my solution works in your case. If not, then you will need to send me much more of your code because I can't solve this problem using the only code sample from the first post.

Best, Kuba



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: 4.25.0
  • Device: desktop
  • Browser: chrome
  • OS: windows 10
  • Provided sample code: No
  • Provided link: No
Tags