How to use mobile default Picker in React web app? - reactjs

I need to use respectively the default iOS and Android Picker in a React web app. I've found a Picker component in React Native which apparently does what I need: https://facebook.github.io/react-native/docs/picker.html Is there any way to import the component in React? Alternatively is it possible to toggle the default picker within React?

There is a project on Github to do exactly what you want called react-native-web which can be found at: https://github.com/necolas/react-native-web
I looked through the repository and found it has the component you want to use.

Related

How to install facebook event pixel in react component

I have a Facebook base code for lead tracking installed in my React app. All I want to do is to add fbq('track', 'Lead'); to my "Thankyou.jsx" component.
All examples I have seen used NextJs but I'm writing just React and Redux.
How do I add fbq('track', 'Lead'); in the react component where I want it to reside?
I tried to search for that and I finally found one named react-facebook-pixel

Are React, ReactJS and React.js different names for the same thing?

Are React, ReactJS and React.js different names for the same thing?
If they are different, what are the differences?
React = react = react.js = reactjs = ...
They all refer to the same JS library.
As Mentioned in their website:
React is a JavaScript library for building user interfaces
From what I know, .js and JS suffixes are a common thing in JavaScript world. Since React is a general world, sometimes they call it ReactJS to show it's a JS library.
Other examples are Next.js, Editor.js, Express.js, Node.js and so on...
Also you can see the website is reactjs.org, but it's called React in the page.
React is a utility package for UI implementation build by javascript.
So the base name is "react", but you can express its language more specifically by attaching js to it and make it bound to the web.
Also, it makes it distinguishable from other libraries called ReactNative.
There is no package such as react.js or ReactJs on npm and the main package is the "react" itself.
These named you've mentioned, might be for the focus on the core name itself, preventing collision from other packages with react itself
There is reactphph but the react keyword is using as a reference to this react not react in any other language or something.

Can we use react js modules in react native?

There is module called react elastic carousel for react js. I want to use it in react native for android. Is it possible?
No, React uses HTML tags to render while React Native uses an abstraction over platform native views. They're not compatible.
NO,
Syntax of React & React Native is similar but they both work differently,
React Native components compile into native App component while reactJS is just HTML.
You can read the Difference Between React & React Native for better understanding

material-ui-pickers v2 - problem with localization on moment

I use Material-ui-pickers in my react project. I use v2.2.4, becouse of Material ui v3 used in my project template. Everything is fine, but i cannot localize it. I follow the example
https://material-ui-pickers-v2.dmtr-kovalenko.now.sh/localization/moment
I import moment/locale/pl
and then globally set
moment.locale('pl')
but console.log still shows locale is 'en' and picker didn't change
Pass moment instance to the MuiPickersUtilsProvider libInstance prop
Make sure you are using lib npm i #date-io/moment moment instead of pure moment lib.
Post your code to smooth the solution.

Can we use Highcharts with React-Native?

Currently I am using Highcharts for my web app, but now I am building an android app using react-native. Will Highcharts work with React-native.
HighCharts works with the DOM. You cannot use HighCharts or charting libraries that depend on the DOM directly in React Native, but you can use charting libraries in a WebView with React Native. I have not use High Charts specifically, but have used other charting libraries with WebView and it works great.
Here you can use this component to send the config json to the componente and it will be displayed
https://github.com/TradingPal/react-native-highcharts
Two main ways you can utilise Highcharts in React Native app are :
WebView component. I used this technique on other platforms (Appcelerator Titanium) as well.
Official minimal Highcharts wrapper for React : highcharts-react-native.
As of now pre-requisite for this are:
node 11.2+
npm 6.7.0+ or similar package manager
React 16.4+
React native 0.59.3+
To install:
npm install #highcharts/highcharts-react-native
NOTE: There are other un-official wrappers as well like react-native-highcharts but I have not used them.
You can use this module:
react-native-highcharts.
It works using the web engine on Android or iOS and the Highcharts JavaScript module to render dynamic charts.
Example:
<ChartView style={{height:300}} config={conf}></ChartView>
Add this line to the ChartView component : originWhitelist={['']}
Example:
<ChartView style={{height:300}} config={conf} originWhitelist={['']}></ChartView>

Resources