javascript - [解决]Warning: validateDOMNesting(...): <tr> cannot appear as a
高洛峰
高洛峰 2017-04-10 16:56:01
0
0
1678

用React js编码时候碰到这个
Warning: validateDOMNesting(...): <tr> cannot appear as a child of <table>. See TopTen > table > tr. Add a <tbody> to your code to match the DOM tree generated by the browser.

源代码片段

render() {
    return (
        <table>
            <tr>
                <th>日期</th>
                <th>耗时</th>
                <th>错误</th>                            
                <th>备注</th>
            </tr>
        </table>
    );
}

根据提示: Add a <tbody> to your code to match the DOM tree generated by the browser.
在tr上面加一层tbody就解决了。

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

全員に返信(0)
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!