Rendering static product data
Git branch
This section uses the https://github.com/PacktPublishing/Mastering-SharePoint-Development-with-the-SharePoint-Framework-/tree/chapter9/adding-static-data-to-form-customizer Git branch from the repository.
In the previous section, we added a form customizer to the solution and got it running to display simple text. Now, let’s see how we can display some static data for products.
As mentioned in the What is a Form Customizer? section, each item in a SharePoint list can be associated with three types of forms – New, Edit, and View. As per the names, the New form is used for creating a new item, the Edit form is used for editing an existing item, and the View form is used for viewing an existing item. In our case, the item is a product and the ProductFormCustomizer.tsx React component should take care of displaying the New, Edit, and View forms of a product.
The idea is such that we determine the current display mode provided...