Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Walkthrough HOC #4

Open
danbovey opened this issue Mar 9, 2018 · 0 comments
Open

Walkthrough HOC #4

danbovey opened this issue Mar 9, 2018 · 0 comments

Comments

@danbovey
Copy link
Contributor

danbovey commented Mar 9, 2018

A higher order component that allows a component that is being walked through to change based on what step the walkthrough is on.

import { connectWalkthrough } from 'react-help-desk';

const Map  = ({ walkthrough }) => (
  <div>
    <GoogleMap>
      {walkthrough.step == 1 && <Marker label="Example Marker" position={latLng} />}
      {walkthrough.step == 2 && <DirectionsRenderer directions={directions} />}
    </GoogleMap>
  </div>
);

export default connectWalkthrough('my-component')(Map);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant