What's new in React

@krutarth_h_dave

Software Engineer @

Krutarth Dave

React v16.6

  • React.memo()

  • React.lazy()

  • static contextType()

React.memo()

React.lazy()

contextType

React v16.7 and Beyond

Problems

  • Wrapper Hell

  • Huge Components

  • Confusing Classes

Suspense

Hooks

• New Feature Proposal available in v16.7-alpha

• Functional Components having Class Components capabilities

 

 

• Completely opt-in and backwards compatible

  • useState

  • useEffect

useState

useEffect

Rules of Hooks

• Only call hooks at the top level

 

​• Only call hooks from React functions (components or custom Hooks)

Custom Hooks

Why hooks are awesome?

• Future Optimizations

 

​• Less code for Developers and Compilers

 

• Increased Readability

 

• Better Organization

Wrapper Hell

Class Component

Using Hooks in Functional Components

THAT'S IT!

THANK YOU!

What's new in React v16.6 and later

By Krutarth Dave

What's new in React v16.6 and later

  • 356