关于#react.js#的问题,请各位专家解答!

<script type="text/babel">
    var divReact = document.getElementById('id-div-react');
    function FormTitle(){
        return <h4>User Loginh4>;
    }
    function UserId(){
        const UserId = (
            <p>User Id(*):<input type="text"/>p>
        );
        return UserId;
    }
    function UserName(){
        const UserName =(
            <p>User Name: <input type="text"/>p>
        );
        return UserName;
    }
    function Password() {
        const passwd = (
            <p>Password(*): <input type="text"/>p>
        )
        return Passwd;
    }
    function Submit(){
        const submit = (
            <p><button>Loginbutton>p>
        );
        return Submit;
    }
    function FormLogin() {
        return (
            <div id="id-div-formlogin">
                <FormTitle/>
                <UserId/>
                <UserName/>
                <Password/>
                <Submit/>
            div>
        );
    }
    const formLogin = <FormLogin/>;
    const reactSpan = (
        <span>
            <h3>bobh3>
            {formLogin}
        span>
    );
    ReactDOM.render(reactSpan, divReact);
script>
![img](https://img-mid.csdnimg.cn/release/static/image/mid/ask/101752056976193.png "#left") ``` 筛选器 默认级别 日2 top react-dom.development.js:25129 Download the React DevToo1s fora better development experience: htt s://fb.me/react-devtoo1s ADYou are using the in-browser E Babel transformer. babel.min.js:12 6 Be suretoprecompileyour scriptsforproduction https://babeljs.io/docs/setup/ 8 Uncaught Error:Target container is react-dom.development.js:24963 O not a DOM element atObject.render(react-dom.development-js:24963:15) at:32:10 atn(babel.min.is:12:27049) atr(babel.min.js:12:27558) ato(babel.min.js:12:27966) atu(babel.min.js:12:28332) atE(babel.min.js:1:6138) 2 ```

返回的 Passwd 和 Submit 都是大写的 但是定义是小写

不知道你这个问题是否已经解决, 如果还没有解决的话:
  • 你可以参考下这个问题的回答, 看看是否对你有帮助, 链接: https://ask.csdn.net/questions/7554399
  • 我还给你找了一篇非常好的博客,你可以看看是否有帮助,链接:今日开发问题:React无法插入图片的解决
  • 除此之外, 这篇博客: ReactJS两个组件进行通信中的 #4楼 部分也许能够解决你的问题, 你可以仔细阅读以下内容或者直接跳转源博客中阅读:

    There are multiple ways to make components communicate. 有多种方法可以使组件进行通信。 Some can be suited to your usecase. 有些可以适合您的用例。 Here is a list of some I've found useful to know. 这是我发现有用的一些清单。


如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^