Skip to content

Commit

Permalink
Merge pull request #1278 from dgreensp/repro-hook-issue
Browse files Browse the repository at this point in the history
Reproduce #1268
  • Loading branch information
theKashey committed Jun 29, 2019
2 parents 70353e5 + 1109b51 commit bc99cf6
Show file tree
Hide file tree
Showing 7 changed files with 470 additions and 242 deletions.
2 changes: 1 addition & 1 deletion examples/parcel/.babelrc
@@ -1,4 +1,4 @@
{
"presets": ["env", "react"],
"presets": ["env"],
"plugins": ["react-hot-loader/babel", "transform-class-properties"]
}
12 changes: 8 additions & 4 deletions examples/parcel/package.json
Expand Up @@ -8,15 +8,19 @@
"start:link": "cp -R ../../dist ./node_modules/react-hot-loader && cp -R ../../*.js ./node_modules/react-hot-loader"
},
"devDependencies": {
"babel-core": "^6.26.3",
"@babel/core": "^7.4.5",
"@babel/preset-env": "^7.4.5",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"babel-preset-env": "^1.7.0",
"parcel-bundler": "^1.12.3"
},
"dependencies": {
"@hot-loader/react-dom": "^16.8.6",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-hot-loader": "^4.8.0"
"react-hot-loader": "^4.11.1"
},
"alias": {
"react-dom": "@hot-loader/react-dom"
}
}
8 changes: 5 additions & 3 deletions examples/parcel/src/App.js
@@ -1,12 +1,14 @@
import React from 'react';
import { hot } from 'react-hot-loader';
import Counter from './Counter';
import { Problem } from './Problem';

const App = () => (
<h1>
const App = () => {
return <h1>
<Problem/>
Hello, world.<br />
<Counter />
</h1>
);
};

export default hot(module)(App);
4 changes: 4 additions & 0 deletions examples/parcel/src/Counter.js
Expand Up @@ -17,3 +17,7 @@ class Counter extends React.Component {
}

export default Counter;

export function useExternalHook() {
React.useEffect(() => {})
}
6 changes: 6 additions & 0 deletions examples/parcel/src/Problem.js
@@ -0,0 +1,6 @@
import { useExternalHook } from './Counter'

export function Problem() {
useExternalHook()
return null
}
3 changes: 1 addition & 2 deletions examples/parcel/src/index.js
Expand Up @@ -3,10 +3,9 @@ import { render } from 'react-dom';
import App from './App';

function renderApp() {
const App = require('./App').default;
render(<App />, root);
}

renderApp();

module.hot.accept(renderApp);
module.hot.accept();

0 comments on commit bc99cf6

Please sign in to comment.