簡體   English   中英

如何在React中使用jQuery.stellar

[英]How to use jQuery.stellar in React

我必須如何配置我的React項目才能使用以下代碼:

$(window).stellar()

我正在使用Webpack和ProviderPlugin,並且設計已經准備就緒-剩下的就是安裝並附加Stellar庫

要將jQuery與React一起使用,下面是示例代碼:

import $ from 'jquery';

... // here goes class definition and constructor 

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

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

我希望這有幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM