Search code examples
reactjsmobx

Is it possible to place simple app with React and MobX within one html page?


I would like just link to libraries by src and use them without Node.JS or Webpack.


Solution

  • Sure, just use the service like unpkg:

    <script crossorigin src="https://unpkg.com/react@17/umd/react.production.min.js"></script>
    <script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js"></script>
    <script crossorigin src="https://unpkg.com/[email protected]/dist/mobx.umd.production.min.js"></script>
    <script crossorigin src="https://unpkg.com/[email protected]/dist/mobxreact.umd.production.min.js"></script>
    

    It will be available through window.React, window.ReactDOM and etc.