Functional and Class Components

Posted Tekkaman

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Functional and Class Components相关的知识,希望对你有一定的参考价值。

Functional and Class Components

  The simplest way to define a component is to write a javascript function:

  

  This function is a valid React component because it accepts a single "props" object argument with data and returns a React element. We call such components "functional" because they are literally JavaScript functions.

  You can also use an ES6 class to define a component:

  

  

  The above two components are equivalent from React\'s point of view.

 

参考:https://facebook.github.io/react/docs/components-and-props.html#functional-and-class-components

以上是关于Functional and Class Components的主要内容,如果未能解决你的问题,请参考以下文章

Get to know Lambda and Functional Interfaces in Java 8

Get to know Lambda and Functional Interfaces in Java 8

Get to know Lambda and Functional Interfaces in Java 8

COMP61021: Modelling and Visualisation

COMP 1043 Problem Solving and Programming

COMP3331/9331 Computer Networks and Applications