React (JavaScript library): Difference between revisions
Line 2: | Line 2: | ||
==Components== | ==Components== | ||
React has two types of components: class components (those which extend React.Component) and function components. | React has two types of components: class components (those which extend React.Component) and function components. | ||
Function components are lighter weight | Function components are lighter weight and should be preferred for new code. | ||
===Function components=== | ===Function components=== |