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

fast-refresh doesn't re-render with figwheel-main #59

Closed
tomekw opened this issue May 25, 2020 · 2 comments
Closed

fast-refresh doesn't re-render with figwheel-main #59

tomekw opened this issue May 25, 2020 · 2 comments

Comments

@tomekw
Copy link
Contributor

tomekw commented May 25, 2020

Hi @Lokeh! Thank you for Helix!

I'm struggling to use fast-refresh with figwheel-main. I managed to add a ns to :preloads which injects a hook and set up a callback when code changes. Basically something like this:

(ns ^:figwheel-hooks fast-refresh
  (:require [helix.experimental.refresh :as r]))

(r/inject-hook!)

(defn ^:after-load refresh
  []
  (r/refresh!))

I know the refresh callback is invoked as it shows the component in the "updated" list but nothing changes on screen. The code is not re-rendered.

I used react 16.13.1, helix 0.0.11, and react-refresh 0.8.2.

Is there anything else needed? Am I missing something?

And of course I will drop a PR with documentation changes when I make it work :) 👋

@tomekw
Copy link
Contributor Author

tomekw commented May 26, 2020

OK, so the problem was I didn't have React Dev Tools installed 🤦🏻‍♂️🕵🏻‍♂️ I will mention this when updating the docs :)

@tomekw tomekw closed this as completed May 26, 2020
@lilactown
Copy link
Owner

Oof that is rough! Thank you for the PR

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

2 participants