Forum Discussion
Steven Tolboe
Jun 19, 2017Iron Contributor
SPFx - Display Rich Text Field
Is there a way in a webpart using SharePoint Frameworks to display rich text (from a list) properly? The strings I want to use contains hyperlinks, line breaks, superscripts...etc.
The only solution I have seen is to use "dangerouslySetInnerHTML". But, this solution can only be done once per component so it doesn't work for what I am doing. I am using a DetailsList compenent from Office UI Fabric to display a list of Q&As. The answers for each question are rich text.
- I would start with this approach:
http://veenstra.me.uk/2017/06/07/office-365-sharepoint-how-to-create-a-form-framework-using-spfx-part-2/
Then within your class you can organise the data as you need it.
I havent implemented the rich text control yet. But there shouldn't be too much of a difference here.