小编Eri*_*sky的帖子

警告:收到非布尔属性 `jsx` 的 `true`。时代风格的 Jsx

我正在尝试将 styled-jsx 与一些代码一起使用。但是,无论我做什么,我似乎都会遇到错误

index.js:1437 Warning: Received `true` for a non-boolean attribute `jsx`.

If you want to write it to the DOM, pass a string instead: jsx="true" or jsx={value.toString()}.
    in style (at App.js:12)
    in div (at App.js:9)
    in Test (created by Route)
    in Route (at App.js:29)
    in Router (created by BrowserRouter)
    in BrowserRouter (at App.js:27)
    in App (at src/index.js:7)
Run Code Online (Sandbox Code Playgroud)

我尝试重新安装 node_modules,确保我的配置都很好,并测试了不同的版本。

我的 package.json,

{
  "name": "preview",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "contentful": "^7.4.1",
    "react": "^16.8.6",
    "react-dom": "^16.8.4",
    "react-router-dom": "^4.3.1",
    "react-scripts": …
Run Code Online (Sandbox Code Playgroud)

ecmascript-6 reactjs babeljs styled-jsx

5
推荐指数
3
解决办法
3147
查看次数

标签 统计

babeljs ×1

ecmascript-6 ×1

reactjs ×1

styled-jsx ×1