Вы можете сделать эту логику вместо componentDidMount
.
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import Dimensions from 'Dimensions';
import {StyleSheet, View, TextInput, Image, Text} from 'react-native';
export default class Chatbot extends Component {
componentDidMount() {
window.__be = window.__be || {};
window.__be.id = "5b3a47b4b30a36000769d821";
(function() {
var be = document.createElement('script'); be.type = 'text/javascript'; be.async = true;
be.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.botengine.ai/widget/plugin.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(be, s);
})();
}
render() {
return (
<View>
<Text>Testing</Text>
</View>
);
}
}