background preloader

React Native

Facebook Twitter

Getting started with React Native: Building UI – NativeBase.io Blog. FlexView: the easiest way to use flex with React – buildo blog. Sort an array by date using moment.js and Lodash - Thomas Kekeisen - thomaskekeisen.de. Initial situation Since I lost too much time with sorting stuff while I wrote this blog, I decided to write this short article.

Sort an array by date using moment.js and Lodash - Thomas Kekeisen - thomaskekeisen.de

I generate the final and static version of my website directly on my computer using gulp. The page description is stored in a json file, so I have to parse this file using javascript. Then I use moment.js and Lodash to sort the files. This is my test case: An array, that contains a date and a title entry for every blog or page entry. Javascript code I want to sort the blog posts descending by date. BlogPosts = _.sortBy(blogPosts, function(o) { return new moment(o.date);}).reverse(); Avoid the date object? If you don't trust the interpreter to treat a date object in a right way, you can just use the .format() method of moment.js to transform the date to a definitely sortable number. blogPosts = _.sortBy(blogPosts, function(o) { return new moment(o.date).format('YYYYMMDD');}).reverse(); Comments.

Tutorial: Build a Messaging App Using React Native - SendBird Blog. This tutorial is based on SDK 2.0 outdated as of Sep. 2016.

Tutorial: Build a Messaging App Using React Native - SendBird Blog

Please refer to the updated sample built with SDK 3.0 here. Get Started With React Native Layouts. GitHub - vhpoet/react-native-styling-cheat-sheet: Most of the React Native styling material in one page. Universal Tab Bar in React Native. React Native has a core component called TabBarIOS, which renders a tab bar at the bottom of the screen on iOS platform.

Universal Tab Bar in React Native

But it doesn’t work on Android. If you want to have tabs in your app that look and work the same on both, iOS and Android, follow this tutorial, and in 15 minutes you’ll learn how to build them. React Native NavigationExperimental in Depth – React Native Training – Medium. The React Native NavigationExperimental API has come a long way since it was first announced almost a year ago today.

React Native NavigationExperimental in Depth – React Native Training – Medium

What we will cover here: NavigationCardStack Implementing a reducer to handle route stateAdding a navigation headerImplementing Redux to handle route stateImplementing Tabs NavigationTransitioner. Integrating Data with React Native — Makeitopen.com - Open Source Learning. This is a series of tutorials designed to introduce React Native and its Open Source ecosystem in plain English, written alongside the building of the F8 2016 app for Android and iOS.

Integrating Data with React Native — Makeitopen.com - Open Source Learning

React, and by extension React Native, allows you to build apps without worrying too much about where your data is coming from, so that you can get on with the business of creating the app’s UI and its logic. In the first part, we mentioned how we were adopting Parse Server to actually hold the data, and we would use Redux to handle it within the app. In this part, we’ll explain how Redux works within React Native apps, and the simple process of connecting Parse Server. The Firebase Blog: The beginners guide to React Native and Firebase. UPDATE: We updated this tutorial for the Firebase 3.1.0 SDK which now supports the Firebase Realtime Database and Firebase Authentication.

The Firebase Blog: The beginners guide to React Native and Firebase

Here at Firebase, we’re big React fans. Firebase synchronizes application state, and React re-renders the application UI based on state changes. Rational App Development. This is a collection of React Native recipes, code snippets, and styling tips and tricks.

Rational App Development

Command Line Getting Started. React.js cheatsheet. Use the React.js jsfiddle to start hacking.

React.js cheatsheet

(or the unofficial jsbin) ReactDOM.render(<Component name="John" />, document.body); Nesting Nest components to separate concerns. See multiple components. var UserAvatar = React.createClass({...}) var Info = React.createClass({ render() { return <div><UserAvatar src={this.props.avatar} /><UserProfile username={this.props.username} /></div>; }}); States & Properties Use props (this.props) to access parameters passed from the parent. Setting defaults. JSON parsing in React Native ListView. React Native Basics: How to Use the ListView Component. ListView — A core component designed for efficient display of vertically scrolling lists of changing data.

React Native Basics: How to Use the ListView Component

Basically it’s a way to create an efficient scrolling component. It’s driven by a data blob and, theoretically, can be infinitely long. Whereas the other core scrollable component, ScrollView, may run into performance issues for very long lists. ListView actually uses a ScrollView as it’s scrollable component behind the scenes, by default, so you can do all of this with a ScrollView if you want to build your own abstraction. ListView is an abstraction that adds a lot of nice things and optimization on top of ScrollView. Basic Usage So what’s the most basic way to use a ListView? A ListView.DataSource does a lot of things behind the scenes that allow us to have an efficient data blob that the ListView component can understand, all from a simple array.

The renderRow function simply returns a component that, well, renders the row. Separator. Todo App with React Native. This post walks you through the process of creating a Todo App for iOS and Android devices with React Native.

Todo App with React Native

If you're new to React Native or CSS Flexbox, it'd be best to walk your way through: Getting Started React NativeLayout with Flexbox What you'll build What you'll need MacOS, XcodeNodeJSNPMReact Native 0.28+ Stack ES6React NativeCSS Flexbox Project structure. Common React Native App Layouts: Login Page. React Native Tutorial: Create Dynamic Animated Lists - Modus Create. Would you like to add some visual sugar to your dynamic lists in React Native? Do you want to create a pleasant visual experience for users of your application? Here’s a tutorial that will give you a step by step approach to creating your own dynamic animated ListView in React Native. Here’s an animated gif to illustrate what I mean by an animated ListView: Every time you want to add or remove something from your list to have the option to apply an animation transition to your elements.

Why could it be more complicated than you initially think in React Native? The ListView Data Source needs to be updated in order to display the new data for whatever operations you want to perform on it. You can check the complete source code in our Github repo and run this demo. Animating the ListView: Adding and Removing Items Animate the Add Process Let’s try to add an item by creating a fade-in animation. This is the default component with the render() method: Build basic navigation and drawer in React Native. Navigating from one screen to another and having a burger menu than when tapping it opens a drawer is a common pattern used in almost every mobile app. For navigating and pushing screens you can use the Navigator component (works for both Android and iOS) and the NavigatorIOS (as you would image, it’s just for iOS).

Also there are a lot of components developed by the community that are built on top of Navigator and NavigatorIOS and offers you some abstraction, however I had some issues with scene transitions in Android, so in this example we’ll use pure React components to have a pretty nice experience in both platforms. For the menu drawer, there are some cool community components too and for this tutorial we’ll use “React-Native-Drawer” which has a really good performance and many options to customize the styles and animations.

Components and Props - React. Edit on GitHub Components let you split the UI into independent, reusable pieces, and think about each piece in isolation. Conceptually, components are like JavaScript functions. They accept arbitrary inputs (called "props") and return React elements describing what should appear on the screen. Functional and Class Components # The simplest way to define a component is to write a JavaScript function: function Welcome(props) { return <h1>Hello, {props.name}</h1>;} React Tutorial: Creating a Simple Application Using React JS and Flux Architecture. This React.js tutorial will teach you how to create a simple todo application using React JS and the Flux architecture.

React JS is making some waves in the community recently due to its alleged performance increases over other heavy favourites (like Angular JS), especially when it comes to writing out lists. As a result, I am interested in how to write an application that’s easy for the user to use while at the same time being quick to get off the ground. One of the big draws for React JS is the virtual DOM that sits behind the scenes for every view, and it’s the reason why React is said to perform so well. When a view requires a rerender, the whole thing is rendered into a virtual copy of the DOM. Once that’s complete, React performs a diff between the virtual DOM and the actual DOM, and applies only the changes that the comparison the diff equation indicates. So, what are you hopefully going to learn by the end of this article? React Native Tutorial: Building Apps with JavaScript.

React Native Tutorial: Build native iOS applications with JavaScript. Update note: This tutorial has been updated to React Native 0.34 by Tom Elliot. The original tutorial was written by iOS Team member Colin Eberhardt. In this React Native Tutorial you’ll learn about a framework for building native iOS and Android applications from Facebook, based on the same principals behind their hugely popular React Javascript Framework for building declarative user interfaces. Over the years there have been many frameworks using JavaScript to create iOS applications (such as PhoneGap or Titanium), so what makes React Native special? (Unlike PhoneGap) with React Native your application logic is written and runs in JavaScript, whereas your application UI is fully native; therefore you have none of the compromises typically associated with HTML5 UI.Additionally (unlike Titanium), React introduces a novel, radical and highly functional approach to constructing user interfaces.

GitHub - jondot/awesome-react-native: An "awesome" type curated list of React Native components, news, tools, and learning material. React: Create maintainable, high-performance UI components. JavaScript — supported by all modern browsers and indisputably the web's de facto native programming language — has direct access to all the richness that the web-as-a-platform offers. Increasingly, complex JavaScript projects have grown beyond the realm of the solitary coding whiz to large teams of collaborating developers. Build an Android App with React Native. In this article I’ll be showing you how to create a Pokedex App with React Native in Android.

The app wont be as full-featured as an app in the Google Play Store, with just a text field for entering the exact name of the Pokemon and then showing details on submission. React Native Layout System - Modus Create. 4. Components for Mobile - Learning React Native [Book] Let’s start by using the <ListView> component. In this section, we are going to build an app that displays the New York Times Best Seller List and lets us view data about each book, as shown in Figure 4-5.

If you’d like, you can grab your own API token from the New York Times. Developing our first iOS App with React Native (pt 2) - User Auth. In this post, I will be going through how we setup Authentication for our HireArt Mobile App. React Native ListView with Section Headers - Modus Create. DevDocs - React Native / ListView. ListView - A core component designed for efficient display of vertically scrolling lists of changing data. The minimal API is to create a ListView.DataSource, populate it with a simple array of data blobs, and instantiate a ListView component with that data source and a renderRow callback which takes a blob from the data array and returns a renderable component.

A framework for building native apps using React. Overview # React Native Tutorial: Building Apps with JavaScript.