paint-brush
Why import React from “react” in a functional component?by@vivek-nayyar
18,504 reads
18,504 reads

Why import React from “react” in a functional component?

by Vivek Nayyar2mApril 30th, 2018
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

When I first started working with React, I always had this confusion that even though my functional component has no reference to React(since I could not see any mention of React keyword in the component), then why do I need to have <code class="markup--code markup--p-code">import React from “react";</code> at the top of my file. 😕

Company Mentioned

Mention Thumbnail
featured image - Why import React from “react” in a functional component?
Vivek Nayyar HackerNoon profile picture
Vivek Nayyar

Vivek Nayyar

@vivek-nayyar

👋 Senior Software Engineer with 5 years' of experience building products for numerous domains.

Learn More
LEARN MORE ABOUT @VIVEK-NAYYAR'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Vivek Nayyar HackerNoon profile picture
Vivek Nayyar@vivek-nayyar
👋 Senior Software Engineer with 5 years' of experience building products for numerous domains.

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite