I'm a beginner in react-native. So, I searched through Google but there wasn't any method to create the message like above. If someone has found out a way, please help...
What you are looking for is called "Toast".
Please beware that it is an Android feature and doesn't exist on ios (they have something similar, don't remember it name.
You can see the React-Native official documentation for more info.
https://www.npmjs.com/package/react-native-tiny-toast
use this library you can shape it the way you want with styles.
You can make use of the npm package: react-native-simple-toast which is supported by both of the platforms i.e. android and iOS and is currently being maintained by its maintainers.
Related
I use react-native-web and share code between ios, android and web.
Is there any technique to target both iOS and Android platform with a single file, and at the same time not target web?
I know that the code below doesn't work, but serves as an example of what I have in mind:
Container.native.js
Container.web.js
so there two ways of having platform specific code in React Native as mentioned here. The method that you are referring to is mentioned here.
Remember that react-native-web is designed firstly to make react native code run on the web, so your designing Mobile first.
It's very easy. For the same example you have given, this is how you can do it:
Container.js // For mobile
Container.web.js // For Web
Also, you can always use Platform.OS for specific Platform specifications.
Hope it helps.
I am trying to add offline support to an AI-based app I am building on React Native, The app is similar to Not Hotdog of Silicon Valley. I recently found out Tenserflow.js and tried to implement it with React native and even outputted my python model to the one that is supported by Tenserflow.js but when I try to import Tenserflow.js inside one of the React Native components using import * as tf from '#tensorflow/tfjs'; this syntax but React Native throws the error, the error screenshot is attached with the question.
Thank You !!!
The short answer is no as stated in the description of the project.
A WebGL accelerated, browser based JavaScript library
The error you are getting shows that it's trying to use window which is part of the DOM API in browsers. React Native has no such API as it's not a browser. You can see that they use window in multiple places in their Core API.
The long answer is a maybe but is out of scope for a StackOverflow answer as it would be akin to asking for a tutorial. To elaborate, I can see two approaches to possibly getting TensorFlow.js to work:
Polyfill everything that is missing:
This might be possible but it probably won't work as you'd expect because it leverages WebGL. I'm not familiar with TensorFlow.js, but I would believe that WebGL is used because it would allow access to GPU acceleration making the workload feasible in the browser. You would need to do something similar in order for it to work well on a mobile device.
Leverage a WebView. However, you may again run into WebGL/performance issues as indicated in older questions such as this.
Since you didn't post any code whatsoever, there is no other guidance that I can give you on this question. One suggestion would be to look at maybe a native module such as react-native-tensorflow and the discussions people had around it.
#tensorflow/tfjs-react-native has been available on npm (in alpha) since late August 2019.
I am fetching strings with markdown from api and trying to use them in react-native project.
Is there any similar library to marked that can be used in react-native or what is the best practice to achieve same result?
I did not have a chance to try any, but it looks like there are some libraries available, that can handle markdown
react-native-markdown
react-native-markdown-view
react-native-simple-markdown
I want to get react-native working for the Apple Watch, but I'm not sure where to start
I started reading the code for the iOS implementation to figure out how they did it there.
My question is: are there any resources or guidelines for help to actually implement react-native (do they ever talk about this aspect of it) or do I need to just read through the code and figure it out on my own?
It would be nice if the react-native team made a document on how they got it up and running on iOS (or Android), though they may already have that out there which is what I'm looking for.
Thanks in advance for any advice and/or help
I was looking into this, too. I will share my findings.
According to this comment from the React Native team back in 2015, the team doesn't have resources to support it, yet.
Right now, we're focused on normal iOS and Android. We still a very small team and don't have the resources to target a different support right now. However, we open sourced React Native in the hope that we get help from the community to build those :)
Someone tried to build one with a lot of reverse engineering, but there are still unsolved issues causing crashes.
the old SDK has dialog methods to present a simple UI for various tasks. this call has been removed from the SDK beta, and there doesn't seem to be anything to replace it. how are we supposed to implement this stuff now?
Are you referring to Facebook's Dialogs?
if so, those are supported in the 3.0 version of the iOS SDK via the DeprecatedHeaders
There are more details here, the example is specifically for the Feed Dialog:
https://developers.facebook.com/docs/howtos/feed-dialog-using-ios-sdk/
Igy's answer is correct, and the link he listed is a good place to start when you need to use the deprecated headers.
Adding some details in terms of our plans; as you know we are starting to provide more native implementations for UI such as the FBFriendPickerViewController, etc. Meanwhile, there is still a need for UIWebView-based dialogs, and we will be adding additional support to the SDK for both native and webview dialogs. For now we are leaning on our backward compatibility with the previous SDK for dialog support. This gives us a chance to gather feedback on the direction we are taking the SDK, which will help to inform our future direction with dialogs and UI features in general.
Hopefully this helps to clarify the thinking a bit. We are eager to hear any feedback you have on the new UI components in the SDK. Thanks!