solid-standalone

0.21.0 • Public • Published

Solid.js Standalone

Tagged Template Literals

<script src="https://unpkg.com/solid-standalone/html.min.js"></script>
<script>
  const { createState } = Solid;
  const { html, render } = SolidDOM;
 
  const App = () => {
    const [state, setState] = createState({counter: 0});
    setInterval(() => setState('counter', c => c + 1), 1000);
    return html`<div>${() => state.counter}</div>`;
  }
  render(App, document.body);
</script> 

HyperScript

<script src="https://unpkg.com/solid-standalone/h.min.js"></script>
<script>
  const { createState } = Solid;
  const { h, render } = SolidDOM;
 
  const App = () => {
    const [state, setState] = createState({counter: 0});
    setInterval(() => setState('counter', c => c + 1), 1000);
    return h('div', () => state.counter);
  }
  render(App, document.body);
</script> 

Readme

Keywords

none

Package Sidebar

Install

npm i solid-standalone

Weekly Downloads

0

Version

0.21.0

License

MIT

Unpacked Size

63.2 kB

Total Files

6

Last publish

Collaborators

  • ryansolid