-
Notifications
You must be signed in to change notification settings - Fork 49.2k
Closed as not planned
Labels
Resolution: StaleAutomatically closed due to inactivityAutomatically closed due to inactivityStatus: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug
Description
React version: 17.0.2
React-refresh version: 0.10.0
This issue is similar to #21179, but ignores default exported unnamed functions instead.
As a code comment suggests, this is a known limitation:
react/packages/react-refresh/src/ReactFreshBabelPlugin.js
Lines 437 to 438 in a817840
// Anonymous direct exports like export default function() {} | |
// are currently ignored. |
Would a fix be considered?
Steps To Reproduce
Given the following files, making changes to Component.js
doesn't trigger a re-render.
main.js
module:
import React from 'react'
import { render } from 'react-dom'
import Component from './Component.js'
function App() {
return <main><Component /></main>
}
render(<App />, window.document.getElementById('root'))
Component.js
module:
import React from 'react'
export default ({ value = "Hello" }) => (<div>{value}</div>)
The current behavior
Making changes to Component.js
does not re-render the element in main.js
.
The transformed Component.js
module does not register the Component
for refresh.
The expected behavior
Making changes to Component.js
does re-render the element in main.js
.
Metadata
Metadata
Assignees
Labels
Resolution: StaleAutomatically closed due to inactivityAutomatically closed due to inactivityStatus: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug