-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: #1478 support react class-component hot-update
- Loading branch information
Showing
4 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
import React from 'react'; | ||
import ClassCmp, { ChildFnCmp, ClassCmp2 } from './ClassCmp'; | ||
import { foo } from './foo'; | ||
export function App() { | ||
return <h1>App {foo}</h1>; | ||
return ( | ||
<h1> | ||
App {foo} <ClassCmp /> | ||
<ChildFnCmp /> | ||
<ClassCmp2 /> | ||
</h1> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
|
||
export default class ClassCmp extends React.Component { | ||
render() { | ||
return <div>Hot update default class component.</div>; | ||
} | ||
} | ||
|
||
export class ClassCmp2 extends React.Component { | ||
render() { | ||
return <div>Hot update export class component.</div>; | ||
} | ||
} | ||
|
||
export function ChildFnCmp() { | ||
return <b>Hot update export function component.</b>; | ||
} |