diff --git a/core/README.md b/core/README.md index faa05cde..05d64c43 100644 --- a/core/README.md +++ b/core/README.md @@ -415,6 +415,59 @@ export default function Demo() { } ``` +More in-depth customization ([#19](https://github.com/uiwjs/react-json-view/issues/19)) + +```tsx mdx:preview +import React from 'react'; +import JsonView from '@uiw/react-json-view'; + +const object = { + _id: "ObjectId('13212hakjdhajksd')", + uid: "test1", + attival_time: new Date('Tue Sep 13 2022 14:07:44 GMT-0500 (Central Daylight Time)'), + __v: 0 +} + +export default function Demo() { + return ( + + }/> + { + if (type === 'type') { + return + } + if (type === 'value' && /ObjectId\(['"](.*?)['"]\)/.test(value)) { + return {children} + } + }} + /> + { + if (type === 'type') { + return + } + }} + /> + { + if (type === 'type') { + return + } + }} + /> + + ) +} +``` + Inspector ```tsx mdx:preview