DefinitelyTyped/types/react-json-pretty/react-json-pretty-tests.tsx
Mark Dascher 71cbf65749 [@types/react-json-pretty] Add replacer, space, and themeClassName props for v1.7 (#38509)
* [@types/react-json-pretty] Add replacer, space, and themeClassName props for v1.7

* use 4 spaces and single quotes
2019-09-25 16:40:45 -07:00

25 lines
617 B
TypeScript

import * as React from "react";
import JSONPretty = require("react-json-pretty");
export class Test extends React.Component {
render() {
const json = {
foo: "bar"
};
const fn = (key: string, value: any) => {
return value;
};
return (
<div>
<JSONPretty json={json} />
<JSONPretty json={JSON.stringify(json)} />
<JSONPretty json={json} replacer={fn} />
<JSONPretty json={json} space={1} />
<JSONPretty json={json} themeClassName="themeName" />
</div>
);
}
}