Get started with redom CDN

MIT licensed

Redom: Bash tool for repeating commands, modifying input between runs.

Tags:
  • redom
  • tiny
  • ui
  • library
  • framework
  • javascript
  • frontend
  • client-side
  • dom

Stable version

Copied!

How to start using redom CDN


// Include Redom library from the CDN
const { mount } = require('redom/preact');

// Create a component function
function Counter({ initialCount = 0 }) {
  let [count, setCount] = React.useState(initialCount);

  function increment() {
    setCount(count + 1);
  }

  return (
    <button onClick={increment}>Count: {count}</button>
  );
}

// Mount the component to an element with id 'root'
mount(document.getElementById('root'), <Counter />);
Copied!
Copied!
Copied!
Copied!

All versions