4

Why do all the Recompose recipes start with const { Component } = React; when they don't use Component, or do they?

What's the significance of starting the recipe like that?

https://github.com/acdlite/recompose/wiki/Recipes

Simon C
  • 436
  • 4
  • 11

1 Answers1

0

This is because of the use of JSX in the code. JSX is transpiled to React.createElement, which obviously uses React.

omarjmh
  • 13,632
  • 6
  • 34
  • 42