Share via

SharePoint Framework with React Router

Mohammed Abed 155 Reputation points
2023-04-16T01:49:52.48+00:00

Hello, I am developing a website with SPFX 1.4.1 on SP2019 On-Premise using React TypeScript. Since the site is not deployed and I am working on an on-prem setting, I am using the local workbench using my machine not on the server itself. So, what is the best way to implement routing and navigation between different web parts ? How can I build my pages and save them on the workbench ? and Lastly, what is the best way for having a global CSS file ?

Microsoft 365 and Office | SharePoint Server | For business
Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint | For business | Windows
Microsoft 365 and Office | SharePoint Server | Development
0 comments No comments

Answer accepted by question author

RaytheonXie_MSFT 40,496 Reputation points Microsoft External Staff
2023-04-17T06:45:26.2666667+00:00

Hi @Mohammed Abed,

As far as I know, You can only preview your webpart in workbench. Please refer to the following document

https://learn.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part#preview-the-web-part

To inject global css file. You can deploy following spfx

https://www.sharepointeurope.com/sharepoint-online-how-to-inject-custom-css-in-modern-sites/


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.