[Feature Request] Hide Root
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- react, typescript
- Domain
- frontend
Research direction
Start by tracing the JsonView component's value-rendering path, especially how array and object roots are displayed. Define the behavior for hiding the root while preserving the existing nested rendering and verify it for both arrays and objects using the examples in the issue; no test file is named in the payload.
Written by the indexing model from the issue text.
Description
Hi
It would be nice to be able to 'hide' the root element.
So for example, for this object:
[
{
"foo": "bar",
"lorem": 1
},
{
"hi": "hello",
"lorem": 2
},
{
"etc": "etera",
"lorem": 3
}
]
Display just:
or:
I achieved similar behavior using:
if (Array.isArray(value)) {
root.render(
<div className="flex flex-col gap-2">
{value.map((item, i) => (
<JsonView
key={i}
value={item}
collapsed={3}
enableClipboard={false}
displayDataTypes={false}
/>
))}
</div>
);
} else {
root.render(
<JsonView
value={value}
collapsed={3}
enableClipboard={false}
displayDataTypes={false}
/>
);
}
but it would be nice to have a built-in feature to reduce code duplication and overhead.
(I guess there's no reason to limit it to just arrays, but that was my particular use case)
- Dominant language
- TypeScript
- Stars
- 420
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from uiwjs/react-json-view
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
uiwjs/react-json-view#92 · 3 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
uiwjs/react-json-view#93 ·
-
Named export Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
uiwjs/react-json-view#90 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 52/100
uiwjs/react-json-view#89 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
uiwjs/react-json-view#88 · 1 reaction ·
All issues in uiwjs/react-json-view
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
area:tools bug good first issue help wanted priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
TaewoooPark/Motifcode#14 ·
-
bug 🐞
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BasedHardware/omi#15320 ·
-
Difficulty 2/5 Half a day Newbie friendliness 78/100
vercel/vercel-plugin#199 ·