Skip to content

Walkthrough HOCΒ #4

@danbovey

Description

@danbovey

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);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions