July 01, 2019
Here is the Dump component!
Dump
const Dump = props => ( <div style={{ fontSize: 20, border: '1px solid #efefef', padding: 10, background: 'white', }}> {Object.entries(props).map(([key, val]) => ( <pre key={key}> <strong style={{ color: 'white', background: 'red' }}> {key} 💩 </strong> {JSON.stringify(val, '', ' ')} </pre> ))} </div>);render(<Dump props={['One', 'Two', 'Three', 'Four']} />);
props 💩[ "One", "Two", "Three", "Four" ]
Written by mcdog who lives in Central Portugal and passes the time playing with code and milking chickens. You should follow him on Twitter