MetaCell / MetaCell/geppetto-meta

Allow React compoenents as menu label type

Open
#77 0 comments 0 reactions 0 assignees View on GitHub
enhancement geppetto-ui geppetto.js
Dominant language
JavaScript
Stars
6
Forks
4
PR merge metrics
No merged PRs in 30d

Description

Example React component as label:
```javascript
const menuConfig = {
...
buttons: [{
label: ,
icon: "",
dynamicListInjector: {
handlerAction: "menuInjector",
parameters: ["ViewMenu"]
},
position: "bottom-start",
style: topLevelMenuItemStyle,
}]
}
```
Actually React components work as menu label, but we get the warning because a string is expected:
> Warning: Failed prop type: Invalid prop `configuration.buttons[0].label` of type `object` supplied to `Menu`, expected `string`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the Menu component and the prop-type declaration for configuration.buttons[].label. Check how the existing label is rendered with the supplied React component, then adjust the accepted label type so the warning no longer appears while rendering remains unchanged. Done means the example configuration works without the invalid-prop warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.