@@ -168,10 +175,12 @@ const App = () => (
Pass labelRenderer
or valueRenderer
.
+
Additionally, you may pass an ArrowComponentOverride
(({raw})):}
valueRenderer={(raw) => (
diff --git a/packages/react-json-tree/src/ItemRange.tsx b/packages/react-json-tree/src/ItemRange.tsx
index ac17679d..9b40c361 100644
--- a/packages/react-json-tree/src/ItemRange.tsx
+++ b/packages/react-json-tree/src/ItemRange.tsx
@@ -34,6 +34,7 @@ export default function ItemRange(props: Props) {
onClick={handleClick}
arrowStyle="double"
ariaLabel={`Expand Array from ${from} to ${to}`}
+ OverrideComponent={props.ArrowComponentOverride}
/>
{`${from} ... ${to}`}
diff --git a/packages/react-json-tree/src/JSONArrow.tsx b/packages/react-json-tree/src/JSONArrow.tsx
index e04f6c95..f0e7aaaf 100644
--- a/packages/react-json-tree/src/JSONArrow.tsx
+++ b/packages/react-json-tree/src/JSONArrow.tsx
@@ -1,7 +1,7 @@
-import React from 'react';
+import React, { ComponentType } from 'react';
import type { StylingFunction } from 'react-base16-styling';
-interface Props {
+export interface JSONArrowProps {
styling: StylingFunction;
arrowStyle?: 'single' | 'double';
expanded: boolean;
@@ -9,17 +9,23 @@ interface Props {
onClick: React.MouseEventHandler
;
ariaControls?: string;
ariaLabel?: string
+ OverrideComponent?: ComponentType;
}
-export default function JSONArrow({
- styling,
- arrowStyle = 'single',
- expanded,
- nodeType,
- onClick,
- ariaControls,
- ariaLabel
-}: Props) {
+export default function JSONArrow({OverrideComponent, ...props}: JSONArrowProps) {
+ const {
+ styling,
+ arrowStyle = 'single',
+ expanded,
+ nodeType,
+ onClick,
+ ariaControls,
+ ariaLabel
+ } = props
+ if(OverrideComponent) {
+ return
+ }
+
return (