Skip to content

Commit

Permalink
enable hot reloading
Browse files Browse the repository at this point in the history
  • Loading branch information
lindapaiste committed May 21, 2023
1 parent 5471f8a commit 3f666da
Show file tree
Hide file tree
Showing 8 changed files with 704 additions and 375 deletions.
11 changes: 10 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,16 @@
"development": {
"plugins": [
"babel-plugin-styled-components",
"react-hot-loader/babel"
"react-refresh/babel"
],
"presets": [
[
"@babel/preset-react",
{
"development": true,
"runtime": "automatic"
}
]
]
}
},
Expand Down
5 changes: 1 addition & 4 deletions client/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { Suspense } from 'react';
import { render } from 'react-dom';
import { hot } from 'react-hot-loader/root';
import { Provider } from 'react-redux';
import { Router, browserHistory } from 'react-router';

Expand Down Expand Up @@ -28,11 +27,9 @@ const App = () => (
</Provider>
);

const HotApp = hot(App);

render(
<Suspense fallback={<Loader />}>
<HotApp />
<App />
</Suspense>,
document.getElementById('root')
);
5 changes: 1 addition & 4 deletions client/modules/Preview/previewIndex.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useReducer, useState, useEffect } from 'react';
import { render } from 'react-dom';
import { hot } from 'react-hot-loader/root';
import { createGlobalStyle } from 'styled-components';
import {
registerFrame,
Expand Down Expand Up @@ -72,6 +71,4 @@ const App = () => {
);
};

const HotApp = hot(App);

render(<HotApp />, document.getElementById('root'));
render(<App />, document.getElementById('root'));
Loading

0 comments on commit 3f666da

Please sign in to comment.