A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.
One-line version to paste in your DevTools
Use $$ if your browser aliases it:
~ 108 byte version
| // getComponent is a function that returns a promise for a component | |
| // It will not be called until the first mount | |
| function asyncComponent(getComponent) { | |
| return class AsyncComponent extends React.Component { | |
| static Component = null; | |
| state = { Component: AsyncComponent.Component }; | |
| componentWillMount() { | |
| if (!this.state.Component) { | |
| getComponent().then(Component => { |
| const fs = require('fs'); | |
| const remark = require('remark'); | |
| const md = fs.readFileSync('./fixtures/alert.md'); | |
| const ast = remark().parse(md); | |
| function getCellValue(node) { | |
| return node.children[0].children[0].value; | |
| } |