Home > Article > Web Front-end > How to introduce plug-ins in react
How to introduce plug-ins in react: first add [(function(answerSheet){)] at the beginning of the js library; then add [})($); module.exports = $;] at the end of the js library That’s it.
The environment of this article: windows10, react16, Dell G3 computer, this article applies to all brands of computers.
(Recommended tutorial: react video tutorial)
Use the module method to introduce a js plug-in:
First add # at the beginning of the js library ##
const $ = require('jquery'); (function(answerSheet){)If the js library references jquery, add
const $ = require('jquery')at the beginning and
})($); module.exports = $;at the end of the js library. Now you can use import in the component.
import answerSheet from './answersheet.js';Related recommendations:
The above is the detailed content of How to introduce plug-ins in react. For more information, please follow other related articles on the PHP Chinese website!