How to use the svelte-native/dom.createElement function in svelte-native

To help you get started, we’ve selected a few svelte-native examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github halfnelson / svelte-native-nativescript-ui / src / listview / index.ts View on Github external
private loadView(viewType: string): View {
        if (viewType.toLowerCase() == ListViewViewType.ItemView.toLowerCase() && typeof this.nativeElement.itemTemplates == "object" ) {
            let keyedTemplate = this.nativeElement.itemTemplates.find(t => t.key == "default");
            if (keyedTemplate) {
                return keyedTemplate.createView()
            }
        }

        let componentClass = this.getComponentForView(viewType);
        if (!componentClass) return null;
        logger.debug("creating view for " + viewType);

        let wrapper = createElement('StackLayout') as NativeViewElementNode
github halfnelson / svelte-native-nativescript-ui / src / autocomplete / index.ts View on Github external
private loadView(viewType: string): View {
        if (viewType != AutoCompleteViewType.ItemView)
            return null;
        
        let suggestionView = this.nativeView.suggestionView
        if (!suggestionView || !suggestionView.__SvelteNativeElement__) return;

        let componentClass = (suggestionView.__SvelteNativeElement__ as SuggestionViewElement).itemTemplateComponent;
        if (!componentClass) return null;

        logger.debug("creating view for " + viewType);

        let wrapper = createElement('StackLayout') as NativeViewElementNode