MetaCell / MetaCell/geppetto-meta
Allow React compoenents as menu label type
- 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