DocumentationRulesdebug/function-component

function-component

Rule category

Debug.

What it does

Reports all function components. Useful for debugging. This rule should only be used for debugging purposes. Otherwise, leave it off.

Examples

import React from "react";
 
function Example() {
  return <button />;
}
import React from "react";
 
const Example = () => <button />;
import React from "react";
 
const Example = React.memo(() => <button />);
import React from "react";
 
const Example = React.forwardRef(() => <button />);