Steps to reproduce the problem
<Popper
referenceElement={element}
placement='right'
>
{({ ref, style, placement, arrowProps }) => (
<div ref={ref} style={style} data-placement={placement}>
Popper element
<div ref={arrowProps.ref} style={arrowProps.style} />
</div>
)}
</Popper>
What is the expected behavior?
Tooltip should show an arrow beside him.
What went wrong?
He doesn't.
Packages versions
react-popper: 1.0.2
Sorry I really need the codepen/codesandbox repro, otherwise I can't help you.
You have to style your arrow to make it visible somehow. Take a look at the demo page to see an example.
So to style its position for the tooltip I need to condition-style the arrow?
Meaning the direction the arrow is pointing at.
react-popper only provides the left or top offset of the arrow, all the styling is deferred to the consumer.
And is there a way to use the already made Arrow component so I wouldn't have to handle the direction the arrow is pointing?
Or that if I want to use the 'referenceElement' prop, I have to manually design and implement the arrow myself?
You can copy the one of the demo, but the library doesn't provide any style except for the positions.