Skip to content

Loader warning "Fast refresh only works when a file only exports components..." #10856

Closed Answered by ccssmnn
fiorins asked this question in Q&A
Discussion options

You must be logged in to vote

Hey! You are exporting both a component and a function from the same file. Fast Refresh only works, when you're exporting components exclusively. For Fast Refresh to work, you need to put your NotePage Component and the loader into different files, e.g., notepage.element.tsx and notepage.loader.ts.

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
5 replies
@radoslavkarlik
Comment options

@ccssmnn
Comment options

@ccssmnn
Comment options

@robertjpayne
Comment options

@joelstein
Comment options

Answer selected by fiorins
Comment options

You must be logged in to vote
2 replies
@joelstein
Comment options

@joelstein
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants