FredKSchott / prefresh

Hot Module Reloading for Preact

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prefresh

Fast-refresh for Preact!

Integrations

Writing your own integration

Best practices

Recognition

We need to be able to recognise your components, this means that components should start with a capital letter and hook should start with use followed by a capital letter. This allows the Babel plugin to effectively recognise these.

Do note that a component as seen below is not named.

export default () => {
  return <p>Want to refresh</p>
}

Instead do:

const Refresh = () => {
  return <p>Want to refresh</p>
}

export default Refresh;

When you are working with HOC's be sure to lift up the displayName so we can recognise it as a component.

About

Hot Module Reloading for Preact

License:MIT License


Languages

Language:JavaScript 97.5%Language:HTML 2.0%Language:CSS 0.5%