sorich87 / bootstrap-tour

Quick and easy product tours with Twitter Bootstrap Popovers
http://bootstraptour.com
MIT License
4.44k stars 942 forks source link

How to implement tour via npm module in react? #716

Open stanislav-grin opened 5 years ago

stanislav-grin commented 5 years ago

Hi, I have a problem during implementation of tour in react app. I've installed tour with npm module, then imported it in module:

import Tour from 'bootstrap-tour'

and in componentDidMount make test use case:

const tour = new Tour({
      steps: [
        {
          element  : '#myId',
          title    : 'Test Navigator',
          content  : 'Content of my step'
        }
      ]
    })

    tour.init()

    tour.start()

The id is valid for this test, but I don't see popup with text, but instead I see next error in console:

bootstrap-tour.js:586 Uncaught TypeError: $element.popover is not a function

What have I missed? Maybe I need some other dependencies to get it work properly?

MovingGifts commented 5 years ago

@stanislav-grin Where you able to get it to run smoothly in react?

stanislav-grin commented 5 years ago

@MovingGifts Unfortunately no. I moved to another library and it fit perfectly. https://github.com/gilbarbara/react-joyride

emreyildiz0 commented 3 years ago

Hey fellows, import jQuery in Root.jsx or relevant file

import $ from 'jquery';
window.jQuery = $;

and then import standalone version import BootstrapTour from "bootstrap-tour/build/js/bootstrap-tour-standalone.min"