gilbarbara / react-joyride

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

beaconComponent works only when defining it inside step object #395

Closed joakimgrr closed 5 years ago

joakimgrr commented 6 years ago

Expected behavior

In the examples this works:

state = {
    beaconComponent: props => <Beacon {...props} />,
    run: true,
    steps: [ ... ]
}

Actual behavior

In my testings the top level beaconComponent is ignored but works when defined like this:

state = {
    run: true,
    steps: [
        {
            beaconComponent: props => <Beacon {...props} />,
            ...
        }
   ]
}

React version

16.3.2

React-Joyride version

2.0.0-11

This might be just a misalignment between the docs and actual behaviour since the 2.0 version is used. If so I'll gladly try to help updating the docs.

gilbarbara commented 6 years ago

I'm not sure I understood this correctly since the Custom example sets the beaconComponent at the tour level and it's working. Are trying to override this props in the step too?

Please post an example at codesandbox.