Thursday, November 14, 2019

How to Learn React Native: Start With These Courses and Tutorials

Whether you’re new to React Native or you’ve been using the framework for years, there’s always something more to learn. This powerful JavaScript-based mobile framework makes it possible to take code that wouldn’t be out of place on a website and turn it into a native mobile app.

With this power, comes a number of techniques, architectures, and design choices of differing complexities to learn. This guide will walk you through some of the best resources available from Envato to help you get started in React Native, and to keep your education going no matter what level you’re currently at.

Before we get started, you might also want to check out some of the excellent React Native app templates available for sale on CodeCanyon. Starting with one of these templates can get your project off to a great start.

 

About the React Native Framework

Mobile apps have been around for a while now, but the recent advent of JavaScript-based application frameworks has completely changed the game. While there are a number of different frameworks out there, React Native has become one of the biggest contenders in the space, powering behemoth apps such as Facebook, Instagram, Discord, AirBnB, and hundreds (if not thousands) more.

Why has React Native become the go-to for app development?

In short, it makes app development exponentially more efficient for both developers and companies. Building off of a central JavaScript code base, React Native reduces, and in many cases, eliminates the duplicated work that used to be necessary to launch both an iOS and Android app. In addition, having a single language that is also widely used within web development means that there are many more developers available to work on projects. This means more help when you run into issues, more documentation on how to do common tasks, and more engineers if the need arises.

Now that we’ve talked a bit about the importance of React Native though, let’s look at the first step of a React Native journey, getting up to speed on JavaScript.

Before Getting Started With React Native

React Native is a powerful framework, but before getting started working with it, there’s some underlying technology that you’ll need to be familiar with. In this case, we’ll be mostly looking at JavaScript, and maybe a little bit of React.

A good place to start is the Practice JavaScript and Learn course series, which can help pin down the basics of JavaScript quickly:

Then you’ll want to expand your knowledge to include Modern JavaScript Fundamentals, and finally nail in your knowledge by completing some projects:

Once you’ve gone through those (or if you happened to already know a bit of JavaScript), you’ll want to pick up some React. React is a JavaScript framework that serves as the base for React Native, and carries a number of similarities, including its structure and dependence on components.

Once you’ve got React down, you’ll be able to apply a lot of that information to a React Native app. If you’re experienced with JavaScript and other frameworks already though, feel free to skip forward to learning React Native.

For the rest of us, check out these courses on the fundamentals of React: 

With React under your belt, now it’s time to dive into React Native. While there are many similarities between React and React Native, there are some important new skills that you’ll need to get your native app rolling. Let’s check them out!

React Native Basics

We’ve got all of our prerequisites met, so now it’s time to dig in.

React Native has two key pieces that we’ll want to tackle first, its architecture and the use of components. Components are often self-contained bits of code or UI, built in a modular nature so that they can be used several times throughout an app (or even be dropped into other programs easily). These are commonly tied to screen elements, such as login screens, buttons, or other interactions. The use of these components as the main building blocks of the app is what gives React Native its unique architecture.

This architecture means that elements are often divided so that their functionality and user interface are separated. Then they are grouped into screens, with each representing a literal screen being shown to a user. This structure makes it easier to debug your code, reuse components between screens, and rewrite components to be used for new purposes.

First you can check out this article on the React Native Ecosystem to get a feel for what all tools, environments, and other useful resources exist. After that, this course on Getting Started with React Native will teach you many of the basics, like setting up your environment, dealing with JSX, and more. Finally, try your hand at putting together your own component by following along with this tutorial on creating a calendar component with React Native.

With those basics out of the way, the next step is to delve into working with and creating full apps. Let’s check that out next.

Building Full Apps with React Native

Awesome, by this point you’ll have a good feel for working in React Native. You know what components are, how to build them into screens, and have put together a few small features by yourself or made some changes to existing code. Next we’re going to look at how you can bring that all together to create fully fledged apps using React Native.

We aren’t quite to the point of building them from scratch yet, but taking an existing template, library, or resource, we’ll figure out how to make it into a usable end product.

A good place to start is to bolster your understanding of JSX and React a bit by taking this deep dive course that will shed more light into their functionality: 

Then take a look at some of the app templates that exist already. Study up on their code, their structure, and their documentation. Even more importantly though, tinker around! Add in your own components, change up how an existing one works, or customize some of the styling. Anything to take it from a standard template to a working minimum viable product will help you to build out the core skills it takes to build React Native Apps.

Here’s a good head start on some of the best ones available through Envato: 

Once you’ve put together a few projects on your own, it’s time to move onto the more advanced parts of React Native.

Advanced Techniques and Features of React Native

When working with more advanced concepts of React Native, there are two directions to go: deep and wide. You can learn more about creating an app from scratch, start to finish, working on every stage (wide). But you might also want to go deeper, looking into specific ways to improve your usage of React Native, such as mastering advanced app structures or really digging into an available library or service (such as Firebase). Or maybe you want to do both!

For going wide, try out this course that walks you through the creation of an app from beginning to end:

If you want to go deep into a specific topic, there’s a lot of them available.

A good start would be getting up to speed on using Expo to work with projects and make it easier to test and deploy: 

You might also want to learn how to plug your app into an expandable, popular back-end such as AWS:

Or, check out some of these more advanced courses on React and React Native:

Building Your React Native Journey

Like any language or framework in programming, you’re never quite finished. As you make your way along your journey, new features pop up all the time and complex edge cases make themselves known. Because of this, your path to learning can be distinct from that of someone else’s.

How did you learn React Native? What are your favorite resources for learning and improving within app development? Let me know!


by Kyle Sloka-Frey via Envato Tuts+ Code

Facebook rolls out a series of new features and here’s what we know about it

Facebook is one of the largest social media platforms that provide its users with hundreds of opportunities on a daily basis. Some people use Facebook as a getaway app from all the life troubles going around whereas some people use the social network to stay more connected with people they love and...

[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]

by agha ali via Digital Information World

Getting Started with Puppeteer

Getting Started with Puppeteer

Browser developer tools provide an amazing array of options for delving under the hood of websites and web apps. These capabilities can be further enhanced and automated by third-party tools. In this article, we'll look at Puppeteer, a Node-based library for use with Chrome/Chromium.

The puppeteer website describes Puppeteer as

a Node library which provides a high-level API to control Chrome or Chromium over the DevTools Protocol. Puppeteer runs headless by default, but can be configured to run full (non-headless) Chrome or Chromium.

Puppeteer is made by the team behind Google Chrome, so you can be pretty sure it will be well maintained. It lets us perform common actions on the Chromium browser, programmatically through JavaScript, via a simple and easy-to-use API.

With Puppeteer, you can:

  • scrape websites
  • generate screenshots of websites including SVG and Canvas
  • create PDFs of websites
  • crawl an SPA (single-page application)
  • access web pages and extract information using the standard DOM API
  • generate pre-rendered content — that is, server-side rendering
  • automate form submission
  • automate performance analysis
  • automate UI testing like Cypress
  • test chrome extensions

Puppeteer does nothing new that Selenium, PhantomJS (which is now deprecated), and the like do, but it provides a simple and easy-to-use API and provides a great abstraction so we don't have to worry about the nitty-gritty details when dealing with it.

It's also actively maintained so we get all the new features of ECMAScript as Chromium supports it.

Prerequisites

For this tutorial, you need a basic knowledge of JavaScript, ES6+ and Node.js.

You must also have installed the latest version of Node.js.

We’ll be using yarn throughout this tutorial. If you don’t have yarn already installed, install it from here.

To make sure we’re on the same page, these are the versions used in this tutorial:

  • Node 12.12.0
  • yarn 1.19.1
  • puppeteer 2.0.0

Installation

To use Puppeteer in your project, run the following command in the terminal:

$ yarn add puppeteer

Note: when you install Puppeteer, it downloads a recent version of Chromium (~170MB macOS, ~282MB Linux, ~280MB Win) that is guaranteed to work with the API. To skip the download, see Environment variables.

If you don't need to download Chromium, then you can install puppeteer-core:

$ yarn add puppeteer-core

puppeteer-core is intended to be a lightweight version of Puppeteer for launching an existing browser installation or for connecting to a remote one. Be sure that the version of puppeteer-core you install is compatible with the browser you intend to connect to.

Note: puppeteer-core is only published from version 1.7.0.

Usage

Puppeteer requires at least Node v6.4.0, but we're going to use async/await, which is only supported in Node v7.6.0 or greater, so make sure to update your Node.js to the latest version to get all the goodies.

Let's dive into some practical examples using Puppeteer. In this tutorial, we'll be:

  1. generating a screenshot of Unsplash using Puppeteer
  2. creating a PDF of Hacker News using Puppeteer
  3. signing in to Facebook using Puppeteer

1. Generate a Screenshot of Unsplash using Puppeteer

It's really easy to do this with Puppeteer. Go ahead and create a screenshot.js file in the root of your project. Then paste in the following code:

const puppeteer = require('puppeteer')

const main = async () => {
  const browser = await puppeteer.launch()
  const page = await browser.newPage()
  await page.goto('https://unsplash.com')
  await page.screenshot({ path: 'unsplash.png' })

  await browser.close()
}

main()

Firstly, we require the puppeteer package. Then we call the launch method on it that initializes the instance. This method is asynchronous as it returns a Promise. So we await for it to get the browser instance.

Then we call newPage on it and go to Unsplash and take a screenshot of it and save the screenshot as unsplash.png.

Now go ahead and run the above code in the terminal by typing:

$ node screenshot

Unsplash - 800px x 600px resolution

Now after 5–10 seconds you'll see an unsplash.png file in your project that contains the screenshot of Unsplash. Notice that the viewport is set to 800px x 600px as Puppeteer sets this as the initial page size, which defines the screenshot size. The page size can be customized with Page.setViewport().

Let's change the viewport to be 1920px x 1080px. Insert the following code before the goto method:

await page.setViewport({
  width: 1920,
  height: 1080,
  deviceScaleFactor: 1,
})

Now go ahead and also change the filename from unsplash.png to unsplash2.png in the screenshot method like so:

await page.screenshot({ path: 'unsplash2.png' })

The whole screenshot.js file should now look like this:

const puppeteer = require('puppeteer')

const main = async () => {
  const browser = await puppeteer.launch()
  const page = await browser.newPage()
  await page.setViewport({
    width: 1920,
    height: 1080,
    deviceScaleFactor: 1,
  })
  await page.goto('https://unsplash.com')
  await page.screenshot({ path: 'unsplash2.png' })

  await browser.close()
}

main()

Unsplash - 1920px x 1080px

The post Getting Started with Puppeteer appeared first on SitePoint.


by Akshay Kadam via SitePoint

“Bitcoin is not a Currency, It is a Financial Asset”, Says the Project Head of Libra

Bitcoin has never been a reliable source of payment. A decade ago, Bitcoin stood at $0.003; whereas, after 7 years, it stands at $20,000. A jump that nobody would have expected from Bitcoin. Apart from it, 2018 has been the worst year for Bitcoin with over 80% of the decline in its value. Two...

[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Madiha via Digital Information World

Instagram Ready to Pay For Production Cost If Celebrities Leave Politics

Instagram is ready to bear the production cost for the videos of celebrities who will not indulge in politics or elections. According to Bloomberg, the Facebook-owned app recently distributed contracts to content creators and brands, clearly stating that the videos that are funded by...

[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Aqsa Rasool via Digital Information World

Facebook Experiments With Machine Learning To Improve Its Facial and Gestures Detection Technology

Technology has progressed quite rapidly over the course of the past few years, but even now with our cutting edge tech some things are just a little too difficult for artificial intelligence (AI) to tackle which is a big part of the reason why Facebook has been working so hard to try and improve...

[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Zia Muhammad via Digital Information World

Website Inspiration: Editorial New

Incredible One Pager showcasing the Editorial New typeface by Pangram Pangram Foundry. As you scroll the page and fonts animate including several interactive content areas to truly experience the typeface.

Full Review


by Rob Hope @robhope via One Page Love