react18-json-view
react18-json-view copied to clipboard
Add displayArrayKey Option for Rendering Array Keys in JSONViewer
Greetings,
I have implemented a new feature in the JSONViewer, introducing an option named displayArrayKey. This feature aims to enhance the user experience by providing additional flexibility in visualizing JSON data.
Feature: 'displayArrayKey' Option
The displayArrayKey option, when set to false, prevents the rendering of the keys of an array and appends a colon to the end of the line. This results in a cleaner and more concise output for users who find array keys unnecessary in certain contexts.
Usage:
<JsonView
src={object}
displayArrayKey={false}
/>
Enabled (without keys):
Disabled (with keys):
Use Case:
This addition is beneficial for developers seeking a streamlined representation of JSON data, especially when handling large arrays where the keys might not contribute significantly to comprehending the data structure.
Documentation:
The documentation has been updated to encompass the new displayArrayKey option, elucidating its function and effect on the JSON data representation.
Conclusion:
I am confident that this feature will serve as a valuable enhancement to the project by offering more versatility in displaying JSON data. I look forward to your feedback and am open to making any necessary modifications.
Thank you for considering this contribution. Looking forward to a positive review and eventual merge.
Best Regards, Nicholas