background preloader

React Native

Facebook Twitter

Sort an array by date using moment.js and Lodash - Thomas Kekeisen - 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 -

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(;}).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. 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 React and React Native is gaining a lot of momentum these days. For this tutorial, we’ll quickly build a messaging app using React Native with SendBird’s JavaScript SDK. 1. 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. If you don’t have any experience with React Native check out 3 Steps to Build Your First Mobile App with React Native. It explains the basics and how to set up required software to get started. What We Will Be Building We’re going to build an app that has a tab bar with three tabs at the top. For your reference, the final code for the app we’re building can be found in this GitHub repo. React Native NavigationExperimental in Depth – React Native Training – Medium. Integrating Data with React Native — - 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 — - 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. 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?

React Native Tutorial: Create Dynamic Animated Lists - Modus Create

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: So far so good. Animate the Removal Process. 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. 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, {}</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. This shift brings with it an entourage of related problems. Working code based on quick hacks becomes impossible for others to comprehend and maintain. Build an Android App with React Native. React Native Layout System - Modus Create. If you’ve been working with web technologies for a while, jumping into React Native is very straightforward, especially if you are familiar with ES6.

Installing the development environment is relatively easy if you are familiar with NPM. Follow the instructions on the official website to get started. The layout system is a fundamental concept that needs to be mastered in order to create great layouts and UIs. React Native uses Flexbox to create the layouts, which is great when we need to accommodate our components and views in different screen sizes or even different devices. 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. Otherwise, use the API token included in the sample code. Lists are extremely useful for mobile development, and you will notice that many mobile user interfaces feature them as a central element. A <ListView> is literally just a list of views, optionally with special views for section dividers, headers, or footers. 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. A framework for building native apps using React.

Overview # React Native Tutorial: Building Apps with JavaScript.