gilbarbara / react-joyride

Create guided tours in your apps
https://react-joyride.com/
MIT License
6.8k stars 525 forks source link

beaconComponent has the wrong type definition #876

Closed dolanmiu closed 10 months ago

dolanmiu commented 1 year ago

🐛 Bug Report

A clear and concise description of what the bug is.

To Reproduce

  1. Follow https://docs.react-joyride.com/custom-components to create a custom beacon (regular React component)

  2. My custom beacon:

    
    const CustomBeacon = (props) => {
        console.log(props);
        return (
            <div>Custom Beacon</div>
        );
    };
  3. Console Output:

    {
        "aria-label": "Open the dialog",
        "title": "Open the dialog",
        "onClick": [Function],
        "onMouseOver": [Function]
    }

    Screenshot 2022-12-20 at 16 36 58

  4. However, type definitions BeaconRenderProps is of:

    export interface BeaconRenderProps {
      continuous: boolean;
      index: number;
      isLastStep: boolean;
      setTooltipRef: () => void;
      size: number;
      step: Step;
    }

    https://github.com/gilbarbara/react-joyride/blob/main/types/index.d.ts#L112-L119

  5. Types are wrong

Expected behavior

I expect the types to be correct