How to make reusable component in SPFx using React JS

Umair Aslam 20 Reputation points
2024-02-28T12:05:31.0533333+00:00

Dear Community,

Is there any way to develop component in SPFx so that I can use it in multiple WebPart's in SharePoint Online. I have multiple WebPart's and each WebPart have separate solution, I want to create component and want to use in different solutions. I did R&D but I didn't found any solution.

Microsoft 365 and Office SharePoint Development
Microsoft 365 and Office SharePoint For business Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2024-02-29T02:58:09.3533333+00:00

    Hi @Umair Aslam,

    Per my research, you could refer to following nice article to create a resuable class

    https://www.c-sharpcorner.com/article/reusable-validation-method-in-spfx/

    ---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.


Your answer

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