Get started with metro CDN

MIT licensed

Metro: JS bundler for React projects, using Webpack.

Tags:
  • css
  • less
  • mobile-first
  • responsive
  • front-end
  • framework
  • web

Stable version

Copied!

How to start using metro CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with metro CDN - cdnhub.io</title>
  <script src="https://cdn.cdnhub.io/metro/4.5.7/metro.min.js"></script>
</head>
<body>
  <button id="button">Click me</button>
  <script type="text/babel">
    import React from 'react';
    import ReactDOM from 'react-dom';

    const App = () => {
      return (
        <button onClick={() => alert('Hello from Metro Bundler!')}>
          Click me
        </button>
      );
    };

    ReactDOM.render(<App />, document.getElementById('root'));

    document.getElementById('button').addEventListener('click', () => {
      ReactDOM.render(<App />, document.getElementById('root'));
    });
  </script>
  <script type="text/babel" src="index.js"></script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!

All versions