How can I initialize mesibo connection in my reactjs web app with django backend.
I dont find any resources of doing that. even though i have included
<script type="text/javascript" src="https://api.mesibo.com/mesibo.js"></script>
in index.html and its loading in browser as well but having initialized the
JavaScript
x
6
1
initializeApiConn = () => {
2
this.setState({
3
api: new Mesibo()
4
})
5
}
6
its not recognizing Mesibo()
can i have any resources and any links to understand this connection of mesibo with reactjs.
———————————
EDIT:
- I have included mesibo js in
<head>
Advertisement
Answer
If you are including mesibo js your index.html, you may need to use window.Mesibo() in ReactJS
Alternatively, use DOM method to load mesibo.
JavaScript
1
4
1
const script = document.createElement("script");
2
script.src = "https://api.mesibo.com/mesibo.js";
3
document.body.appendChild(script);
4