Slowly falling for React Native... oops!
I started writing a couple of applications with React Native
and let me tell you... React Native is awesome! I've always loved React, and have used it to display many of my skills as a web developer. I am no longer afraid to admit that I was a little intimidated by React Native. The strangest part about it was that it doesn't use HTML tags in JSX. With React Native some of the most popular tags you will use are
- View
- SafeAreaView
- Button
- Text
Each one acts very similar to how we use HTML, and stylizing these tags is also very similar in how we would use CSS to interact with JSX in React. Let me show you an example.
function App() {
return(
<Text style={styles.text}>Here is some text!</Text>
)
}
const styles = StyleSheet.create({
text: {
color: 'dodgerblue'
}
});
As you can see (if you're familiar with React) it's really not too different from React for web. If anything, I feel like using React Native is more easy to understand having a decent amount of exposure with it.
One of the best parts of React Native is that it's ability to work on Android and iOS devices. The flexibility is amazing, and the speed is significantly better then using a framework like Ionic.
I've been using Expo with my React Native apps so I can easily preview the application on all of my devices. There is an extremely intuitive menu that comes with testing a React Native application. Posting a preview below.
I hope this goes to show you to just give something a try! I was a little intimidated at first, but after giving it a shot I was overjoyed by how interesting it was to learn about.