shirakaba / react-nativescript

React renderer for NativeScript
https://react-nativescript.netlify.com
MIT License
280 stars 14 forks source link

Assets and embedding files #87

Closed Lelelo1 closed 2 years ago

Lelelo1 commented 2 years ago

Assets and embedding files

Create a folder called assets in src directory

embedd

They become accessible on both Android and iOS.

export function HomeScreen({ navigation }: HomeScreenProps) {
    return (
        <flexboxLayout style={styles.container}>
            <webView height={200} src="~/assets/testIndex.html"/>
        </flexboxLayout>
    );
}

Files are added by NativeScript through adding web pack configuration on running the app. Use --env.verbose to see it.