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.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,632 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,902 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 34,821 Reputation points Microsoft Vendor
    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.