Material-UI React using in static HTML

Viewed 371

I am new to react especially when using with HTML but i want to use in my web page which is HTML.I know that there is way to implant because i saw react documentation here. First i should add

  <script src="https://unpkg.com/react@17/umd/react.development.js" crossorigin></script>
  <script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js" crossorigin></script>

But i dont know how to continue with adding this library. It is MATERIAL-UI React. If anyone knows how to implant it in static HTML wab page, i will be very glad. Sorry for bad English.

1 Answers

You can add the cdn via a script tag like this:

<script src="https://unpkg.com/@material-ui/core@latest/umd/material-ui.development.js" crossorigin="anonymous"></script>

You can also take a look at the example here.

But quoting the docs, this is heavily discouraged:

⚠️ Using this approach in production is discouraged though - the client has to download the entire library, regardless of which components are actually used, affecting performance and bandwidth utilization.

Related