A web-dev-server plugin to enable fast-refresh for Preact components.
npm install @prefresh/web-dev-server
```
npm i --save-dev @prefresh/web-dev-serverOR
yarn add --dev @prefresh/web-dev-server
web-dev-server.config.mjs
`js`
export default {
plugins: ['@prefresh/web-dev-server'],
};
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.
` Want to refreshjsx`
export default () => {
return
};
Instead do:
` Want to refreshjsx
const Refresh = () => {
return
};
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.