Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: Received true for a non-boolean attribute custom #2648

Closed
cxgreat2014 opened this issue Jan 12, 2022 · 3 comments · Fixed by #3049
Closed

Warning: Received true for a non-boolean attribute custom #2648

cxgreat2014 opened this issue Jan 12, 2022 · 3 comments · Fixed by #3049
Assignees
Labels

Comments

@cxgreat2014
Copy link

Why custom attr in here?

my jsonschema : playground

it causes error:

react-dom.development.js:67 Warning: Received `true` for a non-boolean attribute `custom`.

If you want to write it to the DOM, pass a string instead: custom="true" or custom={value.toString()}.
    at select
    at http://localhost:3000/node_modules/.vite/chunk-XPKOMMPR.js?v=cbf5682c:1641:5
    at div
    at http://localhost:3000/node_modules/.vite/chunk-XPKOMMPR.js?v=cbf5682c:1704:5
    at SelectWidget2 (http://localhost:3000/node_modules/.vite/@rjsf_bootstrap-4.js?v=cbf5682c:681:21)
    at Widget.MergedWidget (http://localhost:3000/node_modules/.vite/chunk-HCTMZ6BT.js?v=cbf5682c:16576:33)
    at StringField (http://localhost:3000/node_modules/.vite/chunk-HCTMZ6BT.js?v=cbf5682c:14570:22)
    at div
    at http://localhost:3000/node_modules/.vite/chunk-XPKOMMPR.js?v=cbf5682c:1704:5
    at FieldTemplate2 (http://localhost:3000/node_modules/.vite/@rjsf_bootstrap-4.js?v=cbf5682c:362:17)
    at SchemaField2 (http://localhost:3000/node_modules/.vite/chunk-HCTMZ6BT.js?v=cbf5682c:14476:5)
    at div
    at http://localhost:3000/node_modules/.vite/chunk-XPKOMMPR.js?v=cbf5682c:1408:23
    at div
    at http://localhost:3000/node_modules/.vite/chunk-XPKOMMPR.js?v=cbf5682c:2576:5
    at div
    at http://localhost:3000/node_modules/.vite/chunk-XPKOMMPR.js?v=cbf5682c:1965:5
    at ObjectFieldTemplate2 (http://localhost:3000/node_modules/.vite/@rjsf_bootstrap-4.js?v=cbf5682c:381:32)
    at ObjectField2 (http://localhost:3000/node_modules/.vite/chunk-HCTMZ6BT.js?v=cbf5682c:13863:5)
    at div
    at http://localhost:3000/node_modules/.vite/chunk-XPKOMMPR.js?v=cbf5682c:1704:5
    at FieldTemplate2 (http://localhost:3000/node_modules/.vite/@rjsf_bootstrap-4.js?v=cbf5682c:362:17)
    at SchemaField2 (http://localhost:3000/node_modules/.vite/chunk-HCTMZ6BT.js?v=cbf5682c:14476:5)
    at div
    at http://localhost:3000/node_modules/.vite/chunk-XPKOMMPR.js?v=cbf5682c:1408:23
    at div
    at http://localhost:3000/node_modules/.vite/chunk-XPKOMMPR.js?v=cbf5682c:2576:5
    at div
    at http://localhost:3000/node_modules/.vite/chunk-XPKOMMPR.js?v=cbf5682c:1965:5
    at ObjectFieldTemplate2 (http://localhost:3000/node_modules/.vite/@rjsf_bootstrap-4.js?v=cbf5682c:381:32)
    at ObjectField2 (http://localhost:3000/node_modules/.vite/chunk-HCTMZ6BT.js?v=cbf5682c:13863:5)
    at div
    at http://localhost:3000/node_modules/.vite/chunk-XPKOMMPR.js?v=cbf5682c:1704:5
    at FieldTemplate2 (http://localhost:3000/node_modules/.vite/@rjsf_bootstrap-4.js?v=cbf5682c:362:17)
    at SchemaField2 (http://localhost:3000/node_modules/.vite/chunk-HCTMZ6BT.js?v=cbf5682c:14476:5)
    at div
    at http://localhost:3000/node_modules/.vite/chunk-XPKOMMPR.js?v=cbf5682c:1408:23
    at div
    at http://localhost:3000/node_modules/.vite/chunk-XPKOMMPR.js?v=cbf5682c:2576:5
    at div
    at http://localhost:3000/node_modules/.vite/chunk-XPKOMMPR.js?v=cbf5682c:1965:5
    at ObjectFieldTemplate2 (http://localhost:3000/node_modules/.vite/@rjsf_bootstrap-4.js?v=cbf5682c:381:32)
    at ObjectField2 (http://localhost:3000/node_modules/.vite/chunk-HCTMZ6BT.js?v=cbf5682c:13863:5)
    at div
    at http://localhost:3000/node_modules/.vite/chunk-XPKOMMPR.js?v=cbf5682c:1704:5
    at FieldTemplate2 (http://localhost:3000/node_modules/.vite/@rjsf_bootstrap-4.js?v=cbf5682c:362:17)
    at SchemaField2 (http://localhost:3000/node_modules/.vite/chunk-HCTMZ6BT.js?v=cbf5682c:14476:5)
    at form
    at Form2 (http://localhost:3000/node_modules/.vite/chunk-HCTMZ6BT.js?v=cbf5682c:17493:5)
    at http://localhost:3000/node_modules/.vite/chunk-HCTMZ6BT.js?v=cbf5682c:17972:23
    at ConfigForm (http://localhost:3000/src/addons/components/ConfigForm/ConfigForm.jsx?t=1641958137322:8:8)
    at div
    at div
    at http://localhost:3000/node_modules/.vite/chunk-XPKOMMPR.js?v=cbf5682c:1965:5
    at div
    at Config (http://localhost:3000/src/pages/classic/Config/Config.jsx?import&t=1641958137240:29:19)
    at Routes (http://localhost:3000/node_modules/.vite/chunk-BOPY2C6Z.js?v=cbf5682c:486:5)
    at Router (http://localhost:3000/node_modules/.vite/chunk-BOPY2C6Z.js?v=cbf5682c:433:15)
    at HashRouter (http://localhost:3000/node_modules/.vite/react-router-dom.js?v=cbf5682c:110:5)
    at App

my package.json

{
  "name": "ui",
  "version": "0.0.0",
  "license": "BSD",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview"
  },
  "dependencies": {
    "@rjsf/bootstrap-4": "^3.2.1",
    "@rjsf/core": "^3.2.1",
    "axios": "^0.24.0",
    "bootstrap": "^5.1.3",
    "buffer": "^6.0.3",
    "file-saver": "^2.0.5",
    "file-selector": "^0.2.4",
    "history": "5",
    "react": "^17.0.2",
    "react-bootstrap": "^2.0.4",
    "react-dom": "^17.0.2",
    "react-router": "^6.2.1",
    "react-router-dom": "6",
    "select2": "^4.1.0-rc.0",
    "stream": "^0.0.2",
    "xml-formatter": "^2.6.0",
    "xml-js": "^1.6.11"
  },
  "devDependencies": {
    "@types/node": "^17.0.8",
    "@vitejs/plugin-react": "^1.0.7",
    "sass": "^1.45.1",
    "vite": "^2.7.2"
  }
}

and jsx

import React from "react";
import Form from "@rjsf/bootstrap-4";

export class ConfigForm extends React.Component {
    render() {
        const log = (type) => console.log.bind(console, type);

        return <Form
            schema={this.props.schema}
            onChange={log("changed")}
            onSubmit={log("submit")}
            onError={log("errors")}
        />
    }
}

if switch to @rjsf/core, this error will not happened

@YTeyddie22
Copy link

Hello, may you assign this to me?

@epicfaace
Copy link
Member

Feel free to work on this and submit a PR!

@YTeyddie22
Copy link

thank you @epicfaace

@jacqueswho jacqueswho added the bug label Feb 22, 2022
WillowP added a commit to WillowP/react-jsonschema-form that referenced this issue Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants