We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The CheckBoxGroup type definition in index.d.ts seems incomplete, it is missing a type definition for the optional children prop
The issue is probably similar to the ones reported for List (#6836 still open) and RadioButtonGroup (#6109 fixed and merged)
In a typescript project, when using the children prop, the type should be as defined in the Grommet component documentation:
The type for the children prop is not defined, therefore the compiler expects a REACT.ReactNode and throws an error:
TS2322: Type '(option: (string | CheckBoxType)[], { checked }: { checked: boolean; }) => JSX.Element' is not assignable to type 'ReactNode'.
Package.json extract:
"dependencies": { "@brightcove/player-loader": "^1.8.0", "@reduxjs/toolkit": "^1.9.7", "@testing-library/jest-dom": "^6.1.4", "@testing-library/react": "^14.0.0", "@testing-library/user-event": "^14.5.1", "@types/react": "^18.2.34", "@types/react-dom": "^18.2.14", "@types/youtube": "^0.0.49", "grommet": "^2.34.0", "grommet-icons": "^4.11.0", "grommet-theme-hpe": "^5.1.1", "polished": "^4.2.2", "react": "^18.2.0", "react-dom": "^18.2.0", "react-hook-form": "^7.47.0", "react-redux": "^8.1.3", "react-router-dom": "^6.16.0", "react-scripts": "^5.0.1", "react-syntax-highlighter": "^15.5.0", "styled-components": "^5.3.11", "typescript": "^4.9.5", "web-vitals": "^3.5.0"
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The CheckBoxGroup type definition in index.d.ts seems incomplete, it is missing a type definition for the optional children prop
The issue is probably similar to the ones reported for List (#6836 still open) and RadioButtonGroup (#6109 fixed and merged)
Expected Behavior
In a typescript project, when using the children prop, the type should be as defined in the Grommet component documentation:
Actual Behavior
The type for the children prop is not defined, therefore the compiler expects a REACT.ReactNode and throws an error:
Steps to Reproduce
Your Environment
Package.json extract:
The text was updated successfully, but these errors were encountered: