我正在尝试在 React Native 应用程序的组件内添加标签。下面是我的代码,它似乎不起作用。
谁能告诉我如何解决这个问题?
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 {
render() {
return (
<View>
<Text>Testing</Text>
<script type="text/javascript">
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);
})();
</script>
</View>
);
}
}
我的猜测是您正在编写的代码不会在浏览器中运行。
script 标签用于告诉浏览器:“嘿浏览器,停止。我们这里有一些 javascript。执行它”,所以你应该忘记 script 标签。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)