Skip to content

Commit

Permalink
feat(json viewer): add handling namespace when is an react object
Browse files Browse the repository at this point in the history
  • Loading branch information
snoh666 committed Aug 21, 2023
1 parent 84ada17 commit e11b60a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/js/components/JsonViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ import ArrayGroup from './ArrayGroup';
export default class extends React.PureComponent {
render = () => {
const { props } = this;
const namespace = [props.name];
let namespace = [props.name];
let ObjectComponent = JsonObject;
if (typeof props.name === 'object' && !Array.isArray(props.name)) {
namespace = ['ReactElement'];
}

if (
Array.isArray(props.src) &&
Expand Down

0 comments on commit e11b60a

Please sign in to comment.