React native, are there shell commands lines for generate screens/navigation/... files ? - react-native

From Symfony or Drupal, I used to use the shell for generate templates empty files (pages, entity, ...)
I'm a new react native developer, its really useful to have a console for generate some projects files.
I make several google search but I find nothing..

Basically you can not do this for react native. What you can do is use an editor like WebStorm and add some codes snippets and custom live templates. There is a great tutorial here.

Related

How to use command line tool like gif2webp in react native?

I want to convert gif to webp file in my react native app to send it to other app for further process. After trying many ways I found that this gif2webp command line can do the job and I can convert the gif to webp using cmd in windwos but do not have idea how to integrate it with react native.
tool:https://developers.google.com/speed/webp/docs/gif2webp
If I want to use it with Java files in react native or other rn modules then how to use it? I tried with Process builder but it says could not find the gif2webp.
I searched for RN modules but could not found any.
It will be great help if you can suggest anything.
Check this out. It contains similar tools
https://github.com/tanersener/mobile-ffmpeg
use ffmpeg react native package. It contains libwebp which would do the job

Is it possible to make a webdav client in React Native without the need of native code?

Basically the title says everything.
I want to create a basic WebDav Client to create, download and delete files from the webdav Server.
But I was unable to find a library which is able to achieve this in React Native.
Any suggestions?
I really don't want to write native code for it...
Another thing is that basic authentication has to be possible.
Thanks,
TK
webdav-fs works on React Native after installing react-native-crypto, stream and shimming Node.js core modules (as described here: https://www.npmjs.com/package/react-native-crypto).
Another step I had to take is to uncomment require("crypto"); in the file shim.js created by rn-nodeify.
webdav seems to work.
But in order to compile, I had to install a few standard node modules that are not in react native : stream-browserify (to replace stream), events, buffer, + I replaced crypto by md5.
not sure, but typescript support for the project may be necessary, too.

Share extension react native - expo

I have created a react-native app using expo. Now I am looking for share-extension to the app to import CSV data from email attachment to my app.
I have tried npm package but that does not work for me(I was not able to build my project with that npm package in Xcode)
I think react-native or expo does not have any share API
In this picture, you can see how he got the option to import data into the app.
I understand that without share extension API, I think react-native and Expo both are useless because you can create the app but you don't expand it.
Looking for the solution or any other alternate solution.
I'm afraid this is not possible with expo.
First of all, are you looking for a way to create your own extension, or do you just want your app to be in the "open with list" that you have in the screenshot on the right? (Sharing and "open with" are two distinct things.)
If you just want your app to be listed in the standard "open with list", you do not need to use github.com/alinz/react-native-share-extension since it serves a different purpose. To quote the repo:
This is a helper module which brings react native as an engine to drive share extension for your app.
So with the package you can use react native to create your own share extension
To get your app into the "open with list", you need to go to target settings and change it according to the screenshot (example for MS word). Read more about it here. However, I'm afraid you won't be able to do this with expo without ejecting.
How to get the url of the file in react-native? You need to make sure that libRCTLinking.a is in the Link Binary with Libraries in Xcode (it'll probably be there already). And then you can follow the docs and call Linking.getInitialURL to get the file url. Then it really depends on what you want to do with the file. If you need something complicated, you'll likely need to write native code. If you just want to upload the file to some server, then you can make use of blob support that was added to RN 0.54 in this commit. An example of how to use the blob support is here.

How to make multiple app variants with shared codebase in react native?

I'm trying to understand the possibility of creating a while label product with the help of react native.
The problem to solve is that by using the same codebase and some configurational changes, we get four different applications each with its own branding assets (in both ios and android).
Is it possible to do that in react native?
xcode targets and android flavours are there. How can we architect this under react native way so we don't have to deal with native code/ configuration.
So the way I ended up doing is by using 12 Factor methodology.
The configuration is loaded through the .env file loaded while building the app and then based on that env file all resources are collected on the go.
The configuration took some time but it was well worth at the end.
6 apps (3 iOS and 3 android apps) out of one codebase.
This is the article that explains how to do it.
Adding multiple target pipelines for React Native Apps (and Fastlane CircleCI deployment
well the posibly easiest solution for this woud be you make a folder structure like this
\Common
assets
SharedPic.jpeg
sharedApp
sharedApp.JS
\app1
assets
pic.jpeg
App1.js
\app2
assets
pic.jpeg
App2.js
and then hardlink them :
fsutil hardlink create ".\app1\asstes\pic.jpeg" ".\Common\assets\SharedPic.jpeg"
fsutil hardlink create ".\app2\asstes\pic.jpeg" ".\Common\assets\SharedPic.jpeg"
fsutil hardlink create ".\app1\App1.js" ".\Common\sharedApp\sharedApp.JS"
fsutil hardlink create ".\app2\App2.js" ".\Common\sharedApp\sharedApp.JS"
but be aware! :
all the hard links are exactly the same so the bundler see's it as a real file and not a link but regardless of which file you edit all hard linked files will be edited
(i know on a datastructure-level the last statement isnt fully correct but I think its easier to understand if you think this way )

React Native boilerplate files

this is my situation:
new to react native
familiar with react.js for web
successfully ran the boilerplate from the react-native cli.
Can someone send me links to docs or articles discussing or explaining the files in the boilerplate?
Which files are safe to delete? I want to make a minimized build as possible and understand the whole ecosystem behind it.
I'm sure react native compiles with babel since it has jsx in it. But how?
I just don't understand yet how react native works. Thanks a lot guys.