Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: No known component for element bottomNavigation. #329

Open
grabbels opened this issue Jan 13, 2023 · 2 comments
Open

Comments

@grabbels
Copy link

When using the bottomNavigation UI element the app crashes on opening returning the following error:
"NativeScript encountered a fatal error: Uncaught TypeError: No known component for element bottomNavigation."

The project the issue occurs in

@euggedal
Copy link

Experiencing the same error.
Did you find a solution?

@FredericKarliczek
Copy link

FredericKarliczek commented Feb 26, 2023

Got the same problem and found a solution. In the documentation is this mentioned:

https://svelte-native.technology/docs#tab-navigation
grafik

In order to use "@nativescript-community/ui-material-bottom-navigation" i had to install it via:

ns plugin add @nativescript-community/ui-material-bottom-navigation

Next I followed the instructions for using native native script plugins: https://svelte-native.technology/docs#using-nativescript-plugins

The nessecary components must be registered within the app.ts. My app.ts looks like this:

import { registerNativeViewElement } from 'svelte-native/dom'
import { svelteNativeNoFrame } from 'svelte-native'
import App from './App.svelte'

registerNativeViewElement("bottomNavigation", () => require("@nativescript-community/ui-material-bottom-navigation").BottomNavigation);
registerNativeViewElement("tabContentItem", () => require("@nativescript-community/ui-material-bottom-navigation").TabContentItem);
registerNativeViewElement("tabStrip", () => require("@nativescript-community/ui-material-bottom-navigation").TabStrip);
registerNativeViewElement("tabStripItem", () => require("@nativescript-community/ui-material-bottom-navigation").TabStripItem);

svelteNativeNoFrame(App, {})

Maybe there is a more elegant way. Im myself a beginner with svelte-native but this worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants