Skip to content

Commit 9e81556

Browse files
committed
Update dependencies
1 parent 80df2a8 commit 9e81556

File tree

5 files changed

+902
-554
lines changed

5 files changed

+902
-554
lines changed

package.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,26 @@
2121
"author": "Javi Velasco <[email protected]> (http://javivelasco.com/)",
2222
"license": "MIT",
2323
"devDependencies": {
24-
"babel-cli": "^6.26.0",
25-
"babel-core": "^6.26.0",
26-
"babel-eslint": "^8.2.1",
27-
"babel-jest": "^22.1.0",
28-
"babel-preset-env": "^1.6.1",
29-
"babel-preset-react": "^6.24.1",
30-
"babel-preset-stage-2": "^6.24.1",
31-
"enzyme": "^3.3.0",
32-
"enzyme-adapter-react-16": "^1.1.1",
33-
"eslint": "^4.16.0",
34-
"eslint-config-prettier": "^2.9.0",
35-
"eslint-plugin-import": "^2.8.0",
36-
"eslint-plugin-prettier": "^2.5.0",
37-
"eslint-plugin-react": "^7.6.1",
38-
"jest": "^22.1.4",
39-
"prettier": "^1.10.2",
40-
"prop-types": "^15.6.0",
41-
"react": "^16.2.0",
42-
"react-dom": "^16.2.0",
43-
"rimraf": "^2.6.2"
24+
"babel-cli": "6.26.0",
25+
"babel-core": "6.26.3",
26+
"babel-eslint": "9.0.0",
27+
"babel-jest": "23.4.2",
28+
"babel-preset-env": "1.7.0",
29+
"babel-preset-react": "6.24.1",
30+
"babel-preset-stage-2": "6.24.1",
31+
"enzyme": "3.5.0",
32+
"enzyme-adapter-react-16": "1.3.1",
33+
"eslint": "5.5.0",
34+
"eslint-config-prettier": "3.0.1",
35+
"eslint-plugin-import": "2.14.0",
36+
"eslint-plugin-prettier": "2.6.2",
37+
"eslint-plugin-react": "7.11.1",
38+
"jest": "23.5.0",
39+
"prettier": "1.14.2",
40+
"prop-types": "15.6.2",
41+
"react": "16.4.2",
42+
"react-dom": "16.4.2",
43+
"rimraf": "2.6.2"
4444
},
4545
"peerDependencies": {
4646
"react": "^0.14.9 || ^15.3.0 || ^16.0.0"

src/Tunnel.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ class Tunnel extends Component {
1818
this.setTunnelProps(this.props)
1919
}
2020

21-
componentWillUpdate(nextProps) {
22-
this.setTunnelProps(nextProps)
21+
componentDidUpdate() {
22+
this.setTunnelProps(this.props)
2323
}
2424

2525
componentWillUnmount() {

src/TunnelPlaceholder.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ import React, { Component, Fragment } from 'react'
44
class TunnelPlaceholder extends Component {
55
static propTypes = {
66
children: PropTypes.func,
7-
component: PropTypes.element,
7+
component: PropTypes.oneOfType([PropTypes.node, PropTypes.symbol]),
88
id: PropTypes.string.isRequired,
99
multiple: PropTypes.bool,
1010
}
11+
1112
static defaultProps = {
1213
component: Fragment,
1314
}
15+
1416
static contextTypes = {
1517
tunnelState: PropTypes.object,
1618
}
@@ -33,7 +35,12 @@ class TunnelPlaceholder extends Component {
3335

3436
render() {
3537
const { tunnelState } = this.context
36-
const { id, children: renderChildren, component: Tag, multiple } = this.props
38+
const {
39+
id,
40+
children: renderChildren,
41+
component: Tag,
42+
multiple,
43+
} = this.props
3744
const tunnelProps = tunnelState.getTunnelProps(id)
3845

3946
if (renderChildren) {

tests/Tunnel.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ const TUNNEL_ID = 'GroompyTunnel'
1010
const props = { message: 'Aihop!' }
1111

1212
class Msg extends React.Component {
13-
componentWillMount() {
14-
this.props.willMount && this.props.willMount()
13+
componentDidMount() {
14+
this.props.didMount && this.props.didMount()
1515
}
1616
render() {
1717
const { message } = this.props
1818
return <div className="msg">{message || 'defaultMessage'}</div>
1919
}
2020
}
21-
Msg.propTypes = { message: PropTypes.string, willMount: PropTypes.func }
21+
Msg.propTypes = { message: PropTypes.string, didMount: PropTypes.func }
2222

2323
describe('Tunnel', () => {
2424
it('should render a tunnel passing props', () => {
@@ -108,13 +108,13 @@ describe('Tunnel', () => {
108108

109109
describe('update lifecycle', () => {
110110
const Component = (
111-
{ msg, visible, willMount }, //eslint-disable-line
111+
{ msg, visible, didMount }, //eslint-disable-line
112112
) => (
113113
<TunnelProvider>
114114
<div>
115115
<TunnelPlaceholder id={TUNNEL_ID}>
116116
{({ message }) => (
117-
<Msg message={message || 'Empty'} willMount={willMount} />
117+
<Msg message={message || 'Empty'} didMount={didMount} />
118118
)}
119119
</TunnelPlaceholder>
120120
{visible && <Tunnel id={TUNNEL_ID} message={msg} />}
@@ -148,7 +148,7 @@ describe('Tunnel', () => {
148148
it('should keep children mounted on re-render', () => {
149149
let mountSpy = jest.fn()
150150
const wrapper = mount(
151-
<Component msg={msg1} visible willMount={mountSpy} />,
151+
<Component msg={msg1} visible didMount={mountSpy} />,
152152
)
153153
wrapper.setProps({ msg: msg2 })
154154
expect(mountSpy).toHaveBeenCalledTimes(1)

0 commit comments

Comments
 (0)