简体   繁体   中英

How to use jQuery.stellar in React

How do I have to configure my React project to be able to use the code below:

$(window).stellar()

I'm using Webpack and ProviderPlugin, and design is ready - only thing left is to install and attach Stellar library

To use jquery with React, here is as sample code:

import $ from 'jquery';

... // here goes class definition and constructor 

componentDidMount() {
  $(window).stellar()
}

componentWillUnmount() {
  $(window).stellar("destroy");
}

I hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM