Skip to content

Latest commit

 

History

History
49 lines (37 loc) · 1.15 KB

CDN.mdx

File metadata and controls

49 lines (37 loc) · 1.15 KB
name route
CDN Links
/cdn-links

CDN Links

Production:

<script crossorigin src="https://unpkg.com/@inlet/react-pixi/dist/react-pixi.umd.js"></script>

Development:

<script crossorigin src="https://unpkg.com/@inlet/react-pixi/dist/react-pixi.cjs-dev.js"></script>

Example with dependencies:

<html>
  <head>
    <script crossorigin src="https://unpkg.com/react/umd/react.production.min.js"></script>
    <script crossorigin src="https://unpkg.com/react-dom/umd/react-dom.production.min.js"></script>
    <script crossorigin src="https://unpkg.com/pixi.js/dist/pixi.min.js"></script>
    <script crossorigin src="https://unpkg.com/@inlet/react-pixi/dist/react-pixi.umd.js"></script>
    <script crossorigin src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
  </head>
  <body>
    <div id="root"></div>

    <script type="text/babel">
      const { Stage, Sprite } = ReactPixi;

      const App = () => (
        <Stage>
          <Sprite texture={PIXI.Texture.WHITE} tint={0x00ff00} />
        </Stage>
      );

      ReactDOM.render(<App />, document.getElementById("root"));
    </script>
  </body>
</html>