Skip to content

Latest commit

 

History

History

raw-html

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

raw-html

Incorporate raw HTML into a React app.

Overview

This is a working example that showcases how you might incorporate raw HTML into a React app at runtime. This is a use-case when your app has a source of raw HTML that it needs to incorporate into the web page. For example, you might have a Markdown document that you send to the GitHub "markdown-to-HTML" API and now you want to splice the HTML into the page.

I posted this code as an answer to a StackOverflow question.

Instructions

Follow these instructions to build and serve the program:

  1. Pre-requisite: Node.js
    • I used version 20.11.0
  2. Install the dependencies
    • npm install
  3. Serve the content (and build continuously)
    • npm start
  4. Open the browser

Reference