Adding the ability to use TopNavigation component for rendering the popover-based components
See original GitHub issueIssue type
I’m submitting a … (check one with “x”)
- bug report
- feature request
Issue description
Current behavior: At the moment there is no possibility to use the TopNavigationAction component for showing Popover-based components since the TopNavigation component restricts the expected element by the properties of TopNavigationAction component.
Expected behavior: No ts errors. For example: Type ‘OverflowMenuProps’ is not assignable to type ‘TopNavigationActionProps’.
Related code:
private renderRightControl = (): React.ReactElement<OverflowMenuProps> => {
const { themedStyle } = this.props;
return (
<OverflowMenu
style={themedStyle.menu}
visible={this.state.menuVisible}
placement='bottom end'
items={this.items}
onRequestClose={this.onMenuPress}
onSelect={this.onMenuItemPress}>
<TopNavigationAction
icon={MenuIconAuth}
onPress={this.onMenuPress}
/>
</OverflowMenu>
);
};
private renderRightControls = (): React.ReactElement<TopNavigationActionProps>[] => {
return ([
this.renderRightControl(),
]);
};
Issue Analytics
- State:
- Created 4 years ago
- Comments:16 (4 by maintainers)
Top Results From Across the Web
UI Kitten - Top Navigation - component overview - GitHub Pages
TopNavigation provides a heading component for the entire page. ... Rendering of React Native components in a web browser is an experimental feature...
Read more >Navigation Component | Adobe Experience Manager
The Navigation Component allows users to easily navigate a globalized site structure.
Read more >React Router Tutorial: Adding Navigation to your React App
In this React Router tutorial, you will learn how to add navigation throughout your single page application.
Read more >Navbar
Ensure accessibility by using a <nav> element or, if using a more generic element such as a <div> , add a role="navigation" to...
Read more >React Navbar Tutorial - Beginner React JS Project - YouTube
The navbar will be a navbar component and will include all the props and functions. If you've ever wondered, "How do you build...
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 Free
Top 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
Well, doing something like this will not break the ts build (this is simplified Top Navigation with Menu example).
Note the return type of the
renderMenuAction
function. It isTopNavigationActionElement
but the actual rendered element isOverflowMenu
. The code below will not throw ts errors.@ng-kode nice catch, thank you 😃 will refactor the documentation somehow…