2016-10-13 20:01:11 +00:00
|
|
|
import React, { Component } from 'react'
|
2016-10-21 16:39:20 +00:00
|
|
|
import { style } from 'next/css'
|
2016-10-13 20:01:11 +00:00
|
|
|
|
|
|
|
export default class CrazyCSS extends Component {
|
|
|
|
spans () {
|
|
|
|
const out = []
|
|
|
|
for (let i = 0; i < 1000; i++) {
|
2016-10-21 16:39:20 +00:00
|
|
|
out.push(<span key={i} class={spanStyles[`padding-${i}`]}>This is ${i}</span>)
|
2016-10-13 20:01:11 +00:00
|
|
|
}
|
|
|
|
return out
|
|
|
|
}
|
|
|
|
|
|
|
|
render () {
|
|
|
|
return <div>{this.spans()}</div>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const spanStyles = {}
|
|
|
|
for (let i = 0; i < 1000; i++) {
|
2016-10-21 16:39:20 +00:00
|
|
|
spanStyles[`padding-${i}`] = style({ padding: i })
|
2016-10-13 20:01:11 +00:00
|
|
|
}
|