react-dir
v0.0.2
Published
A react component that can do a console.dir()-like listing of any object passed to it.
Downloads
7
Readme
react-dir
react-dir is a react component for rendering arbitrary JS data (strings, numbers, objects, etc), similar to console.dir()
or console.log()
in a browser.
Install
It hasn't been published yet, but once it is you will install like this:
npm install react-dir
Usage
react-dir
provides a Dir
component that receives some value to render. More examples can be found in the documentation page.
import React from "react";
import ReactDOM from "react-dom";
import Dir from "./Dir";
ReactDOM.render(
<Dir value={{a: 1, b: "String", c: [1,2,3]}}>,
document.getElementById("root")
);
TODO
- [x] Support constant values (null, NaN, undefined)
- [x] Support primitive types (Strings, numbers, booleans)
- [x] Support nested objects and arrays
- [x] Support custom coloring
- [x] Support React components (pass through)
- [ ] Support Promises
- [ ] Support Observables (RxJS)