1 of 21

The State of React and React native

2 of 21

Youssouf EL Azizi

Full stack web developer at Obytes

Open source contributor,Blogger

https://elazizi.com/

Amine Hakkou

Software Engineer at xHub

OSS believer, FP lover

https://hakkou.me/

3 of 21

ReactJs :

A JavaScript library for building user interfaces

4 of 21

ReactJs

  • 16.0 React Fiber, SSR streaming, error boundaries, arrays in render, portals
  • 16.1 - 16.2 maintenance release
  • 16.3 New lifecycles and context API ref improvements.
  • 16.4 Pointer Events
  • 16.5 React Profiler
  • 16.6 lazy, memo suspense and contextType
  • 16.7.0-alpha Hooks
  • πŸ”₯πŸ”₯πŸ”₯

5 of 21

16.6 lazy, memo suspense and contextType

A form of PureComponent/shouldComponentUpdate for function components, a way to do code splitting using Suspense and an easier way to consume Context from class components.

6 of 21

πŸ”₯πŸ”₯πŸ”₯ Suspense πŸ”₯πŸ”₯πŸ”₯

In short: the new feature allows you to defer rendering part of your application tree until some condition is met (for example data from an endpoint or a resource is loaded).

7 of 21

React.memo

This helps boost the performance by avoiding re-rendering if not needed.

React.lazy

Code-Splitting with Suspense

static contextType

Consume Context as a static property

8 of 21

Hands-on

Agenda

  • React.memo
  • React.lazy
  • Suspense and react-cache

9 of 21

16.7.0-alpha: Hooks

Hooks are a new feature proposal that lets you use state and other React features without writing a class.

10 of 21

Motivation

Sharing stateful logic

React doesn’t offer a way to β€œattach” reusable behavior to a component (for example, connecting it to a store).

Splitting stateful logic and side effects from Components.

In many cases it’s not possible to break these components into smaller ones because the stateful logic is all over the place. It’s also difficult to test them.

11 of 21

No Breaking Changes

Completely opt-in

You can try Hooks in a few components without rewriting any existing code.

100% backwards-compatible.

Hooks don’t contain any breaking changes.

Available now

yarn add react@16.7.0-alpha.0

12 of 21

Hooks At a glance

Visit this Sandbox if you want to try it!

13 of 21

Hands-on

Agenda

14 of 21

React Native :

Build native mobile apps using JavaScript and React Top open source projects

15 of 21

React Native Notes

Be Ready

HMR to build apps faster, but ...

React Native Difficulty Curve

Easy to start with, hard to Scale

Do I need to learn java/swift stuff ?

Mmm, highly recommended ( Native modules )

16 of 21

List

Use FlatList

Navigation

React-navigation ( javascript solution ) or react-native-navigation ( native solution)

17 of 21

What is New In React Native ?

18 of 21

πŸ”₯πŸ”₯πŸ”₯ JSI πŸ”₯πŸ”₯πŸ”₯

The communication between JavaScript and the VM is being standardized using a JavaScript Interface (JSI). Fabric uses JSI to expose methods to JavaScript code. Using JSI, JavaScript can hold reference to C++ Host Objects and invoke methods on them. ( proposal )

19 of 21

A healthy GitHub repository

Issues and pull requests get handled within a reasonable period of time.

Excellent documentation.

Focus on helping users create high quality experiences, and up-to-date API reference docs.

Stable APIs

  • Removing non-core and unused components.
  • Move project to community repo

20 of 21

?

21 of 21

Resources