question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Type definitions prevent children for MenuProvider

See original GitHub issue

Trying 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:

  1. Clone this repo.
  2. cd example
  3. yarn install && yarn start
  4. 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:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
hrishioacommented, Aug 14, 2022

Sounds good - I’ll try upgrading.

0reactions
harshhhdevcommented, Aug 14, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found