"functional component" -> "function component" (#14123)

This commit is contained in:
locknono
2018-11-06 17:33:26 -08:00
committed by Sophie Alpert
parent b4608dd24c
commit 2aecbcd6f1
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -81,7 +81,7 @@ import React from "react";
import { createSubscription } from "create-subscription";
// Start with a simple component.
// In this case, it's a functional component, but it could have been a class.
// In this case, it's a function component, but it could have been a class.
function FollowerComponent({ followersCount }) {
return <div>You have {followersCount} followers!</div>;
}
@@ -164,7 +164,7 @@ function LoadingComponent({ loadingStatus }) {
}
}
// Wrap the functional component with a subscriber HOC.
// Wrap the function component with a subscriber HOC.
// This HOC will manage subscriptions and pass values to the decorated component.
// It will add and remove subscriptions in an async-safe way when props change.
const PromiseSubscription = createSubscription({
@@ -282,12 +282,12 @@ export default {
// Gets the function name for our code path. If the function name is
// `undefined` then we know either that we have an anonymous function
// expression or our code path is not in a function. In both cases we
// will want to error since neither are React functional components or
// will want to error since neither are React function components or
// hook functions.
const codePathFunctionName = getFunctionName(codePathNode);
// This is a valid code path for React hooks if we are direcly in a React
// functional component or we are in a hook function.
// function component or we are in a hook function.
const isSomewhereInsideComponentOrHook = isInsideComponentOrHook(
codePathNode,
);
@@ -83,7 +83,7 @@ describe('ReactDOMServerIntegration', () => {
expect(div.textContent).toBe('Test');
});
describe('memoized functional components', () => {
describe('memoized function components', () => {
beforeEach(() => {
resetModules();
});