Open timkelty opened 4 years ago
I wanted to display the handle value, positioned below the handle.
The easiest way to do this seemed to be pass my own handle that rendered children with the label. eg:
handle
const Handle = ({buttonOffset = 0, ...handleProps}) => { const value = handleProps['aria-valuenow']; return ( <DefaultHandle {...handleProps}> <span style={{ position: 'absolute', top: 30, left: 0, right: 0, }} > {value} </span> </DefaultHandle> ); };
Works great, except I get a propType warning, because DefaultHandle is expecting exact props:
Warning: Failed prop type: DefaultHandle: unknown props found: children
Seems like children could safely be added to it's allowed props?
What if you wrap the DefaultHandle with a div instead?
@ljharb definitely could, but I was trying to piggyback off the already positioned DefaultHandle, as I want to display the label right below the handles.
I wanted to display the handle value, positioned below the handle.
The easiest way to do this seemed to be pass my own
handle
that rendered children with the label. eg:Works great, except I get a propType warning, because DefaultHandle is expecting exact props:
Seems like children could safely be added to it's allowed props?