[BUG] Type definitions prevent children for MenuProvider
See original GitHub issueTrying out kmenu for a small personal project, awesome work!
Describe the bug Trying to run the example project, as well as import into my own, gives the following error:
Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & Pick<MenuContext, "config" | "dimensions">'. TS2559
8 | const App = () => {
9 | return (
> 10 | <MenuProvider>
| ^
11 | <main className={styles.main}>
12 | <h1 className={styles.title}>Hello, World!</h1>
13 | <p className={styles.description}>
Simple fix:
Update type definition for MenuProvider
in kmenu/dist/types.d.ts
to:
export declare type MenuProviderProps = Pick<MenuContext, 'config' | 'dimensions'> & {children: JSX.Element};
To Reproduce Steps to reproduce the behavior:
- Clone this repo.
cd example
yarn install && yarn start
- Node version: 14.18.1, Typescript version 3.9.10
Out-of-context query
Is there a better way to style the menu other than using the random class names? Appreciate any help!
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Menus - Android Developers
For all menu types, Android provides a standard XML format to define menu items. Instead of building a menu in your activity's code,...
Read more >primitives/Menu.tsx at main · radix-ui/primitives - react - GitHub
Radix Primitives is an open-source UI component library for building high-quality, accessible design systems and web apps. Maintained by @workos.
Read more >react-contexify - npm
Define which component can display the menu. import { ContextMenuProvider, menuProvider } from 'react-contexify'; //wrap your component with ...
Read more >Extending The Admin Interface in Optimizely CMS 12
You would need to define multiple UrlMenuItems within your MenuProvider. No hierarchy of objects is required here as Optimizely organises your ...
Read more >Code 401 "The requested URL returned error ... - Unity Forum
Bug Failed to parse response: Code 401 "The requested URL returned error: ... I've also not come across anyone with the same type...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sounds good - I’ll try upgrading.
I’ve also just released
v1-beta-git
. You can read the release notes here.Please do let me know if you’re still met with this issue.