How do you Navigate between pages in SPFx(React) Teams solution .

%3CLINGO-SUB%20id%3D%22lingo-sub-3343060%22%20slang%3D%22en-US%22%3EHow%20do%20you%20Navigate%20between%20pages%20in%20SPFx(React)%20Teams%20solution%20.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3343060%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EWe%20can%20use%20React%20links%20to%20navigate%20between%20pages%20in%20a%20normal%20website%2C%20but%20in%20React%20spfx%20solution%20there%20is%20no%20links%20that%20we%20can%20use%2C%20so%20how%20would%20you%20navigate%20between%20%2C%20pages%20in%20React%20spfx%20solution.%20%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3ESomething%20I%20came%20up%20with%20was%2C%20conditional%20rendering%20of%20all%20the%20components%20and%20putting%20them%20all%20in%20a%20single%20file%2C%20and%20passing%20callback%20function%20as%20props.%20but%20in%20this%20case%20I%20have%20to%20forecefully%20execute%20UseEffect%20when%2C%20a%20page%20is%20rendered%20%2C%20or%20the%20master%20page%20is%20rendered.%20Instead%20of%20this%20is%20there%20anything%20that%20can%20be%20done.%20for%20navigating%20between%20pages%20in%20React%20using%20SPFx%20solution%20for%20TEAMS.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3343060%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESPFx%20React%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

We can use React links to navigate between pages in a normal website, but in React spfx solution there is no links that we can use, so how would you navigate between , pages in React spfx solution.
Something I came up with was, conditional rendering of all the components and putting them all in a single file, and passing callback function as props. but in this case I have to forecefully execute UseEffect when, a page is rendered , or the master page is rendered. Instead of this is there anything that can be done. for navigating between pages in React using SPFx solution for TEAMS.

0 Replies