Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update codepen template #843

Open
teodragovic opened this issue Apr 22, 2022 · 0 comments
Open

Update codepen template #843

teodragovic opened this issue Apr 22, 2022 · 0 comments

Comments

@teodragovic
Copy link
Contributor

On demos and examples link to codepen template opens broken pen.

I think the template can be rewritten to use functional component and import via skypack direct in pen (makes it a bit more obvious where preact comes from vs using codepen settings)

minimal example:

import { h, render, Fragment } from 'https://cdn.skypack.dev/preact';
import { useState } from 'https://cdn.skypack.dev/preact/hooks';

/** @jsx h */

const App = () => {
   const [ counter, setCounter  ] = useState(1);
   
   return (
      <div>Hello world</div>
   );
}; 

render(<App />, document.body);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant