Closed mtr1990 closed 8 months ago
Hey @mtr1990
Yes, out of the box, the tooltipComponent doesn't get the helpers. You could enhance your custom component before passing it to Joyride.
function Tooltip(props: TooltipRenderProps & { helpers?: StoreHelpers }) {
...
}
function App() {
const TooltipWithHelpers = useCallback(
/** You could set this directly in the props, but it would be recreated at every render.
* So, using the useCallback is better for this case.
*/
(tooltipProps: TooltipRenderProps) => <Tooltip helpers={helpers.current} {...tooltipProps} />,
[],
);
return (
<>
<Joyride tooltipComponent={TooltipWithHelpers} />
...
</>
);
}
🐛 Bug Report
Can't pass
helpers
intooltipComponent
to be able to access thego
, resetmethods
...Expected behavior
Pass
helpers
intooltipComponent
to be able to access the go, reset methods..Link to repl or repo (highly encouraged)
Based on the example code you provided. (CustomComponents) https://codesandbox.io/p/sandbox/condescending-payne-4vnnxm?file=%2Fsrc%2FCustomComponents%2Findex.tsx%3A280%2C11