-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed nollup running the demo app + migrated from react-hot-loader to…
… react-refresh
- Loading branch information
Showing
29 changed files
with
112 additions
and
167 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
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
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
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
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,33 +1,29 @@ | ||
import React from 'react'; | ||
import ReactDom from 'react-dom'; | ||
import ReactHotLoader from 'react-hot-loader'; | ||
|
||
import createStepLogger from '../createStepLogger'; | ||
|
||
const text = 'change me when the app is running please'; | ||
|
||
let DemoComponent = ({ children }) => ( | ||
const DemoComponent = ({ children }) => ( | ||
<div> | ||
<h4>{text}</h4> | ||
{children} | ||
</div> | ||
); | ||
|
||
DemoComponent = ReactHotLoader.hot(module)(DemoComponent); | ||
|
||
DemoComponent.whyDidYouRender = true; | ||
|
||
export default { | ||
description: 'React Hot Reload Of Tracked Component', | ||
fn({ domElement, whyDidYouRender }) { | ||
fn({ reactDomRoot, whyDidYouRender }) { | ||
const stepLogger = createStepLogger(); | ||
|
||
whyDidYouRender(React); | ||
|
||
stepLogger('initial render'); | ||
ReactDom.render(<DemoComponent>yo!</DemoComponent>, domElement); | ||
reactDomRoot.render(<DemoComponent>yo!</DemoComponent>); | ||
|
||
stepLogger('render with same props', true); | ||
ReactDom.render(<DemoComponent>yo!</DemoComponent>, domElement); | ||
reactDomRoot.render(<DemoComponent>yo!</DemoComponent>); | ||
}, | ||
}; |
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,8 +1,11 @@ | ||
import React from 'react'; | ||
import ReactDom from 'react-dom'; | ||
import ReactDom from 'react-dom/client'; | ||
|
||
import App from './App'; | ||
|
||
const domMenuElement = document.getElementById('menu'); | ||
const element = document.getElementById('menu'); | ||
|
||
const root = ReactDom.createRoot(element); | ||
|
||
root.render(<App/>); | ||
|
||
ReactDom.render(<App/>, domMenuElement); |
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
Oops, something went wrong.