How to build an Expo Library using Native Modules

  Рет қаралды 14,229

Dan's React Native Lab

Dan's React Native Lab

Күн бұрын

A tutorial on how to create native modules using Expo!
Follow me on Twitter 🐦 / wa2goose
Subscribe to my Insta 📷 my handle is: dan.rnlab
Sample Project: github.com/friyiajr/expo-samp...
Device:
* Android 13 Pixel 7
* iOS 16 iPhone X
=========================
00:00 Introduction
01:33 Set up the Project
06:57 Android Implementation
14:14 Android Result
14:48 iOS Implementation
17:22 iOS Result

Пікірлер: 46
@dylanclements1875
@dylanclements1875 Жыл бұрын
So glad someone’s made a video on this topic, I got so lost in the documentation. Thanks so much
@jjrise
@jjrise Жыл бұрын
Love your topics for videos. It’s like the practical side of RN. Keep it up!
@ggchicote
@ggchicote 8 ай бұрын
Thanks dan! My first approach with Native Modules. Even though I found it a bit hard - mainly the Kotlin part -, it went well. Thanks
@nucleartux
@nucleartux Жыл бұрын
Thank you. Keep going!
@brucehe9517
@brucehe9517 Жыл бұрын
Really helpful video 👏
@manishchhetri
@manishchhetri Жыл бұрын
Great stuff - you got a subscriber
@nikhilranka9660
@nikhilranka9660 Жыл бұрын
Thanks for creating this concise tutorial. Wanted to know how simple it is to build a native UI and show it in a React Native app.
@DanRNLab
@DanRNLab Жыл бұрын
It’s not too bad if you use Expo Build a Native View Library with Expo, React-Native, Swift and Kotlin kzbin.info/www/bejne/mV7Xd3R6jbiWe6s
@Forfiter9
@Forfiter9 11 ай бұрын
Hi, when i am adding a native library which is inside the project how i have to link it to the module to be able to use it?
@uniquity4082
@uniquity4082 11 ай бұрын
How should AsyncFunction work in a Swift module? I have been trying to fetch Apple MusicKit data from a function but I get an unhandled promise rejection with Error: Received 0 arguments, but 1 was expected. The only parameter defined on the expo AsyncFunction is promse: Promise so not sure what is going on
@dannyprudhomme
@dannyprudhomme Жыл бұрын
My example folder has no other folders in it. Has anyone else had issues finding this folder?
@edxmo2921
@edxmo2921 Жыл бұрын
Would it be possible to add android native dependencies to the expo modules? Like I don't know using a maven library along with your custom native code? Sorry if the question seems stupid, I'm just getting started into integrating native dependencies in react native projects
@DanRNLab
@DanRNLab Жыл бұрын
In theory it should be possible. I haven’t dug into it myself though.
@dhananjay7513
@dhananjay7513 8 ай бұрын
I have a doubt that's indirectly related to expo architecture, does Expo Module Internally use expo dev client for building project? Or if I decide to use expo module in existing project I have to add dev client as dependency, because I always get confused between dev client and expo pre build
@Raiwulf
@Raiwulf 8 ай бұрын
how do you get your profile under tab automatically at 1:59?
@junangameplays3271
@junangameplays3271 Жыл бұрын
awesome
@EdwinRebolledo
@EdwinRebolledo Жыл бұрын
Could you explain how to publish as a library on npm? please
@AsgardMarcella
@AsgardMarcella 27 күн бұрын
Hello I tried to generate some numbers with Expo React Native, but the app every Time, Do you think if i create a react Native plugin in Java it will be Lighter ?
@user-di1od1nn7w
@user-di1od1nn7w Жыл бұрын
Great Video! Is there any way to run expo-module-scripts using windows OS
@ahmedgameel7377
@ahmedgameel7377 7 ай бұрын
When I try to build it using eas it fails with gradle error
@andrzejhanusek3718
@andrzejhanusek3718 Жыл бұрын
Great content! BTW, If I would like to use this new approach and don't want to publish my modules on npm (even on private npm) do I have to use monorepo approach? Because it's not possible to keep those modules alongside app code, or I'm missing something?
@Barthap10
@Barthap10 Жыл бұрын
No idea why YT keeps deleting my comment
@Barthap10
@Barthap10 Жыл бұрын
Anyway, it is possible by creating a directory named modules in app root or configuring this in package json. You can search for expo-mega-demo GH repo - I did such thing there
@DanRNLab
@DanRNLab Жыл бұрын
Thanks for jumping in here @Barthap !
@stevenmajek
@stevenmajek Жыл бұрын
Gettting "npm install exited with non-zero code: 1" while using the following command: "npx create-expo-module my-module". Any help?
@shazam314
@shazam314 Жыл бұрын
Are you using windows?
@anseev704
@anseev704 5 ай бұрын
Weirdly enough, got an error saying that 'babel-plugin-module-resolver' could not be found. Fixed by installing it from within the 'example' folder with npm ('npm i babel-plugin-module-resolver'). Might be specific to me, but leaving it here just in case anyone else stumbles on the same thing.
@vladimirvucetic243
@vladimirvucetic243 2 ай бұрын
Do you maybe know how in kotlin to import Promise when using expo modules.import expo.modules.core.Promise? This seems not working?
@elki_8
@elki_8 Жыл бұрын
How you get this project view ? I can't do this. I'm on Linux.
@DanRNLab
@DanRNLab Жыл бұрын
For Android the same instructions should hold. For iOS you need to use MacOS for Xcode
@NicholasEduardo
@NicholasEduardo Жыл бұрын
I was working with RN, but don’t expo. It’s not hate, but I don’t feel good working with that. Now I can change my opinion with evolution of expo and use it in production?
@Barthap10
@Barthap10 Жыл бұрын
You can use expo modules in a bare RN app too
@NicholasEduardo
@NicholasEduardo Жыл бұрын
@@Barthap10 thanks man
@vladimirvucetic243
@vladimirvucetic243 Жыл бұрын
Is it possible that you can run expo run:ios and expo run:android at the same time like when you do in rn cli. If I run react-native run-ios it start server and if I run react-native run-android they share metro instance. I can’t find if this is possible in expo and it suck to build all the time to debug on different platform?
@DanRNLab
@DanRNLab Жыл бұрын
They will share a metro instance if you compile both. You have to wait for one to finish building before you run the other though. Also please don’t forget the -device flag. This project only works on hardware and not simulators
@vladimirvucetic243
@vladimirvucetic243 Жыл бұрын
@@DanRNLab and if both are built is there command in expo to start metro like npm start in standard rn cli project?
@DanRNLab
@DanRNLab Жыл бұрын
You should be able to run expo start
@vladimirvucetic243
@vladimirvucetic243 Жыл бұрын
@@DanRNLab yes that is actually the problem I am struggling. Expo start tries to open prebuild app in expo go so basicaly I always need to run expo build:ios to run app
@DanRNLab
@DanRNLab Жыл бұрын
@@vladimirvucetic243 that is pretty strange, I ran this in my terminal and for me `expo start` just opens the bundler with no issues. It doesn't do prebuild or anything like that. Maybe you misconfigured something by mistake?
@swp44744
@swp44744 Жыл бұрын
can you add expo native modules in existing expo app which does not have ios and android folders?
@DanRNLab
@DanRNLab Жыл бұрын
No, you would need to run prebuild which generates those folders for you
@swp44744
@swp44744 Жыл бұрын
@@DanRNLab Thanks Dan for the quick response, what are my options if I need to use native modules in existing Expo app? btw you got a new subscriber. great work. thank you.
@DanRNLab
@DanRNLab Жыл бұрын
Thanks for subscribing 🙂. If you want to use native modules in an existing Expo app you can run prebuild as long as you are on a compatable version of Expo. I can’t remember if that starts on 47 or 48. If you run npx expo prebuild it generates the iOS and Android folders for you and allows you to have access to the Native Modules API.
@swp44744
@swp44744 Жыл бұрын
Thank you so much Dan.
Build a Native View Library with Expo, React-Native, Swift and Kotlin
12:20
Dan's React Native Lab
Рет қаралды 4,7 М.
Build React Native modules with Swift
39:15
Scott Batson
Рет қаралды 8 М.
WHO DO I LOVE MOST?
00:22
dednahype
Рет қаралды 80 МЛН
бесит старшая сестра!? #роблокс #анимация #мем
00:58
КРУТОЙ ПАПА на
Рет қаралды 3,4 МЛН
Increíble final 😱
00:37
Juan De Dios Pantoja 2
Рет қаралды 114 МЛН
Moving Off React Native
20:50
Theo - t3․gg
Рет қаралды 179 М.
Why I moved to React Native
12:06
Simon Grimm
Рет қаралды 42 М.
Expo CLI vs React Native CLI
8:20
Full Stack Niraj
Рет қаралды 24 М.
KMP vs. Flutter - Who Will Win The Cross-Platform Battle?
16:19
Philipp Lackner
Рет қаралды 33 М.
15 Python Libraries You Should Know About
14:54
ArjanCodes
Рет қаралды 370 М.
What's an Expo Development Build?
5:10
evening kid
Рет қаралды 44 М.
Add Java Native Module inside React Native Project
19:11
Full Stack Niraj
Рет қаралды 13 М.
Type-Safe Navigation with the OFFICIAL Compose Navigation Library
10:03
Неразрушаемый смартфон
1:00
Status
Рет қаралды 2,3 МЛН
Secret Wireless charger 😱 #shorts
0:28
Mr DegrEE
Рет қаралды 2,5 МЛН