codehike
codehike copied to clipboard
Next.js fast refresh doesn't work
When I add the following code, fast-refresh breaks:
```python mark=1[22:30]
print("Rendered with Code Hike")
Without the above code, fast-refresh works as expected.
This issue isn't present in the contentlayer example.
How are you using it with Next.js? What do you mean that it breaks? The page doesn't refresh or the state is not preserved? An example repo would help.
How are you using it with Next.js?
I'm using this example.
What do you mean that it breaks?
When I make a change in the markdown file, the whole Next.js page gets reloaded and then the new changes are visible. The new changes should be visible with hot reload.
Note: This isn't noticeable in the Contentlayer example. In that example, the changes show up without a page reload.
OK, I think I know why this happens. I'll try to fix it soon.
ok, it isn't easy to fix. I'm going to leave it for later.
No problem.
@pomber can you share any details re/ why you think it happens? I'm hitting this as well.
@pomber can you share any details re/ why you think it happens? I'm hitting this as well.
There are some useState I need to remove from a few Code Hike components, but it isn't a trivial refactor