When using the example using-preact
to create a new project, the Fast-Refresh doesn't work as expected.
Steps to reproduce the behavior, please provide code snippets or a repository:
using-preact-example
: yarn create next-app --example using-preact using-preact-app
yarn dev
pages/index.js
and saveOn changing any text inside JSX elements it should reflect on development environment.
Fast Refresh is a React feature, so it's expected to not work with Preact.
The example needs to be updated for Preact's specialized support.
Hi @Timer, I can work on this. Can you kindly assign me to this issue?
I believe the Preact team has started on this @shakib609. Let's see if @jovidecroock has some input before we proceed.
Hey @Timer @shakib609
I have some input yes, I fixed this issue in this PR for the demo we're maintaining https://github.com/developit/nextjs-preact-demo/pull/16 this replaces react-fast-refresh
with prefresh
.
I've opened #13976 to update the using-preact
example so that it matches the latest version from nextjs-preact-demo
including @JoviDeCroock's fix. We're likely going to publish a dedicated Next.js Preact plugin since the configuration here is nontrivial.
I was thinking exactly that when I saw it today.
I've opened #13976 to update the
using-preact
example so that it matches the latest version fromnextjs-preact-demo
including @JoviDeCroock's fix. We're likely going to publish a dedicated Next.js Preact plugin since the configuration here is nontrivial.
Awesome! Can I support you here somehow?
any news wether someone is working on a next.js preact plugin? 🥺
We've published next-plugin-preact @vitordino
just found it ✨ great work guys.. just opened an PR on the using-preact
example to make it the _official_ ™ way
Closing this issue as the plugin is already published :smile:
I've got a setup based on the preact example and fast refresh seems to be working but I still get this annoying warning:
warn - Fast Refresh is disabled in your application due to an outdated
reactversion. Please upgrade 16.10 or newer! Read more: https://err.sh/next.js/react-version
Do I need to just get over it :sweat_smile: or is this something you'd be open to removing/fixing/rewording?
I can confirm this warning happens to me as well 👍
Minor addition If I use yarn I (also) see the message, but not with npm. -> was wrong, also with npm
Most helpful comment
I've opened #13976 to update the
using-preact
example so that it matches the latest version fromnextjs-preact-demo
including @JoviDeCroock's fix. We're likely going to publish a dedicated Next.js Preact plugin since the configuration here is nontrivial.