How to reference a third-party js? in es6

recently added Wechat login function, the project is created through create-react-app, similar to
1 in the following figure, how should js be referenced? Can the sections of
2 and js be written directly into Component?


  1. you can directly introduce
  2. into the entrance index.html as mentioned above.
  3. can also use the npm package scriptjs to directly reference a third party js, in component, such as:
import $script from 'scriptjs'

$script('xxx.js', function () {
  console.log('load xxx.js success')
})

export default class Catalogue extends Component {
...
}

can be introduced directly into index.html.


Wechat has a npm package for wx-jssdk, which is loaded into the project, import, directly and then use it according to the documentation

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e88090-ea4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e88090-ea4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?