File tree Expand file tree Collapse file tree 2 files changed +29
-36
lines changed Expand file tree Collapse file tree 2 files changed +29
-36
lines changed Original file line number Diff line number Diff line change 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}
Original file line number Diff line number Diff line change 11import React from 'react'
22import ReactDOM from 'react-dom'
3- import { Transition , animated } from 'react-spring'
4-
3+ import Loadable from 'react-loadable'
54import './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+ )
You can’t perform that action at this time.
0 commit comments