Skip to content

Commit 340cbc1

Browse files
committed
this keeps happening ...
1 parent 211f713 commit 340cbc1

File tree

2 files changed

+29
-36
lines changed

2 files changed

+29
-36
lines changed

.size-snapshot.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"gzipped": 2150
66
},
77
"dist/web.umd.js": {
8-
"bundled": 87368,
9-
"minified": 36167,
10-
"gzipped": 12190
8+
"bundled": 87346,
9+
"minified": 36148,
10+
"gzipped": 12177
1111
}
1212
}

examples/index.js

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,31 @@
11
import React from 'react'
22
import ReactDOM from 'react-dom'
3-
import { Transition, animated } from 'react-spring'
4-
3+
import Loadable from 'react-loadable'
54
import './styles.css'
65

7-
function Sub() {
8-
return <div style={{ backgroundColor: 'pink', height: 100 }}>Hey</div>
9-
}
10-
11-
class App extends React.Component {
12-
state = { toggle: false }
13-
handleClick = () => {
14-
this.setState({ toggle: !this.state.toggle })
15-
}
16-
render() {
17-
return (
18-
<div className="App">
19-
{this.state.toggle ? <div>true</div> : <div>false</div>}
20-
<button onClick={this.handleClick}>button</button>
21-
<Transition
22-
from={{ opacity: 0, height: 0 }}
23-
enter={{ opacity: 1, height: 'auto' }}
24-
leave={{ opacity: 0 }}>
25-
{this.state.toggle &&
26-
(style => (
27-
<animated.div style={{ ...style, background: 'orange' }}>
28-
<Sub />
29-
</animated.div>
30-
))}
31-
</Transition>
32-
</div>
33-
)
34-
}
35-
}
6+
const components = [
7+
'scroll',
8+
'parallax',
9+
'nativespring',
10+
'transitions',
11+
'areas',
12+
'trails',
13+
'reveals',
14+
'timing',
15+
'sunburst',
16+
'gestures',
17+
'tree',
18+
'morph',
19+
].map(path =>
20+
Loadable({
21+
loader: () => import('./demos/' + path),
22+
loading: () => <div />,
23+
})
24+
)
3625

37-
const rootElement = document.getElementById('root')
38-
ReactDOM.render(<App />, rootElement)
26+
ReactDOM.render(
27+
<div className="app-container">
28+
{components.map((Component, i) => <Component key={i} />)}
29+
</div>,
30+
document.getElementById('root')
31+
)

0 commit comments

Comments
 (0)