uiwjs / react-json-view

A React component for displaying and editing javascript arrays and JSON objects.
https://uiwjs.github.io/react-json-view/
MIT License
212 stars 12 forks source link

fix: Do not render ellipses when the number of items is 0 #48

Closed korkt-kim closed 6 months ago

korkt-kim commented 6 months ago
import JsonView from '@uiw/react-json-view';

const example = [
  {
    "a":[],
    "b":{},
    "c":['c1','c2'],
    "d":{d1:1,d2:2}
  },
]

export default function App() {
  return (
    <JsonView 
      value={example} 
      collapsed={2}
    >
    </JsonView>
  );
}

Ellipsis is being rendered on aand b even though their values are empty

jaywcjlove commented 6 months ago

@korkt-kim thx! upgrade v2.0.0-alpha.24