mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* [@types/react-json-pretty] Add replacer, space, and themeClassName props for v1.7 * use 4 spaces and single quotes
25 lines
617 B
TypeScript
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>
|
|
);
|
|
}
|
|
}
|