A React function component is a JavaScript function that accepts props as an argument and returns JSX to define the UI, serving as the standard approach for modern React development. Unlike class components, they do not require the this keyword, are simpler to write and test, and are slightly faster due to fewer internal abstractions.

With the introduction of React Hooks, function components can now manage state and handle side effects (previously exclusive to class components), making them versatile for both stateless and stateful applications. While they traditionally lacked lifecycle methods, hooks like useEffect now allow them to replicate behaviors such as componentDidMount and componentDidUpdate.

Key Characteristics

  • Definition: Created using the function keyword or arrow functions (e.g., const Component = () => JSX).

  • Data Flow: Receive data via props (properties) passed from parent components, which are read-only.

  • State Management: Uses Hooks like useState to handle local state and useEffect for side effects.

  • Performance: Generally more efficient than class components because they avoid the overhead of creating component instances.

Function vs. Class Components

FeatureFunction ComponentsClass Components
SyntaxSimple JavaScript functionsES6 classes extending React.Component
StateManaged via Hooks (e.g., useState)Managed via this.state and this.setState
LifecycleHandled by Hooks (e.g., useEffect)Dedicated methods (e.g., componentDidMount)
this KeywordNot requiredRequired to access props and state
PerformanceSlightly faster due to fewer abstractionsSlightly slower due to more internal logic

The first thing to note is that stateless functional components cannot have methods: You shouldn't count on calling update or draw on a rendered Ball if it is a stateless functional component.

In most cases you should declare the functions outside the component function so you declare them only once and always reuse the same reference. When you declare the function inside, every time the component is rendered the function will be defined again.

There are cases in which you will need to define a function inside the component to, for example, assign it as an event handler that behaves differently based on the properties of the component. But still you could define the function outside Ball and bind it with the properties, making the code much cleaner and making the update or draw functions reusable:

// you can use update somewhere else
const update = (propX, a, b) => { ... };
    
const Ball = props => (
  <Something onClick={update.bind(null, props.x)} />
);

If you're using hooks, you can use useCallback to ensure the function is only redefined when any of its dependencies change (props.x in this case):

const Ball = props => {
  const onClick = useCallback((a, b) => {
    // do something with a, b and props.x
  }, [props.x]);

  return (
    <Something onClick={onClick} />
  );
}

This is the wrong way:

const Ball = props => {
  function update(a, b) {
    // props.x is visible here
  }
    
  return (
    <Something onClick={update} />
  );
}

When using useCallback, defining the update function in the useCallback hook itself or outside the component becomes a design decision more than anything: You should take into account if you're going to reuse update and/or if you need to access the scope of the component's closure to, for example, read/write to the state. Personally I choose to define it inside the component by default and make it reusable only if the need arises, to prevent over-engineering from the start. On top of that, reusing application logic is better done with more specific hooks, leaving components for presentational purposes. Defining the function outside the component while using hooks really depends on the grade of decoupling from React you want for your application logic.

Another common discussion about useCallback is whether to always use it for every function or not. That is, treat is as opt-in or always recommendable. I would argue to always use useCallback: I've seen many bugs caused by not wrapping a function in useCallback and not a single scenario where doing so affects the performance or logic in any way. In most cases, you want to keep a reference while the dependencies don't change, so you can use the function itself as a dependency for other effects, memos or callback. In many cases the callback will be passed as a prop to other elements, and if you memoized it with useCallback you won't change the props (thus re-render) other components independently of how cheap or costly that would be. I've seen many thousands of functions declared in components and not a single case in which using useCallback would have any down side. On the other hand most functions not memoized with useCallback would eventually be changed to do so, causing serious bugs or performance issues if the developer doesn't recognize the implications of not doing so. Technically there is a performance hit by using useCallback, as you would be creating and additional function but it is negligible compared to the re-declaration of the function that always has to happen either you use useCallback or not and the overall footprint of React and JavaScript. So, if you are really concerned about the performance impact of useCallback versus not using it, you should be questioning yourself if React is the right tool for the job.

Answer from Marco Scabbiolo on Stack Overflow
🌐
React
legacy.reactjs.org › docs › components-and-props.html
Components and Props – React
They accept arbitrary inputs (called “props”) and return React elements describing what should appear on the screen. The simplest way to define a component is to write a JavaScript function:
🌐
Robin Wieruch
robinwieruch.de › react-function-component
React Function Components - Robin Wieruch
December 23, 2024 - This in-depth guide shows you everything about React Function Components, which are basically just JavaScript Functions being React Components which return JSX (React’s Template Syntax), so that after you have read this tutorial you should be well prepared to implement modern React applications with them.
Discussions

Where should functions in function components go?
I'm trying to convert this cool animation I found here into a React reusable component. It looks like this component would require one parent component for the canvas, and many children components for the function Ball(). More on stackoverflow.com
🌐 stackoverflow.com
What's the difference between a React.FunctionComponent and a plain JS function component?
These two examples accomplish the same thing. But what are the differences under the hood? I understand functional components vs. React.Component and React.PureComponent, but I haven't been able to... More on stackoverflow.com
🌐 stackoverflow.com
Please say "Function Component" instead of "Functional Component"
I love using functional components More on reddit.com
🌐 r/reactjs
61
0
December 20, 2022
Why are function components better than class components?
Just watch the hooks reveal video from a few years back. They go through all the problems class components create and how hooks solve them. I think Dan Abramov did the presentation? Edit: docs have an embed here https://reactjs.org/docs/hooks-intro.html More on reddit.com
🌐 r/reactjs
76
63
April 4, 2022
🌐
React
react.dev › reference › react › Component
Component – React
We recommend defining components as functions instead of classes. See how to migrate. Component is the base class for the React components defined as JavaScript classes.
🌐
GeeksforGeeks
geeksforgeeks.org › reactjs › reactjs-functional-components
ReactJS Functional Components - GeeksforGeeks
Functional components are the basic building blocks in React used to create and manage user interface elements.
Published   February 20, 2026
🌐
React TypeScript Cheatsheets
react-typescript-cheatsheet.netlify.app › function components
Function Components | React TypeScript Cheatsheets
React.FunctionComponent is explicit about the return type, while the normal function version is implicit (or else needs additional annotation).
🌐
W3Schools
w3schools.com › react › react_components.asp
React Components
Components come in two types, Class components and Function components, in this tutorial we will concentrate on Function components. In older React code bases, you may find Class components primarily used.
Find elsewhere
Top answer
1 of 5
231

The first thing to note is that stateless functional components cannot have methods: You shouldn't count on calling update or draw on a rendered Ball if it is a stateless functional component.

In most cases you should declare the functions outside the component function so you declare them only once and always reuse the same reference. When you declare the function inside, every time the component is rendered the function will be defined again.

There are cases in which you will need to define a function inside the component to, for example, assign it as an event handler that behaves differently based on the properties of the component. But still you could define the function outside Ball and bind it with the properties, making the code much cleaner and making the update or draw functions reusable:

// you can use update somewhere else
const update = (propX, a, b) => { ... };
    
const Ball = props => (
  <Something onClick={update.bind(null, props.x)} />
);

If you're using hooks, you can use useCallback to ensure the function is only redefined when any of its dependencies change (props.x in this case):

const Ball = props => {
  const onClick = useCallback((a, b) => {
    // do something with a, b and props.x
  }, [props.x]);

  return (
    <Something onClick={onClick} />
  );
}

This is the wrong way:

const Ball = props => {
  function update(a, b) {
    // props.x is visible here
  }
    
  return (
    <Something onClick={update} />
  );
}

When using useCallback, defining the update function in the useCallback hook itself or outside the component becomes a design decision more than anything: You should take into account if you're going to reuse update and/or if you need to access the scope of the component's closure to, for example, read/write to the state. Personally I choose to define it inside the component by default and make it reusable only if the need arises, to prevent over-engineering from the start. On top of that, reusing application logic is better done with more specific hooks, leaving components for presentational purposes. Defining the function outside the component while using hooks really depends on the grade of decoupling from React you want for your application logic.

Another common discussion about useCallback is whether to always use it for every function or not. That is, treat is as opt-in or always recommendable. I would argue to always use useCallback: I've seen many bugs caused by not wrapping a function in useCallback and not a single scenario where doing so affects the performance or logic in any way. In most cases, you want to keep a reference while the dependencies don't change, so you can use the function itself as a dependency for other effects, memos or callback. In many cases the callback will be passed as a prop to other elements, and if you memoized it with useCallback you won't change the props (thus re-render) other components independently of how cheap or costly that would be. I've seen many thousands of functions declared in components and not a single case in which using useCallback would have any down side. On the other hand most functions not memoized with useCallback would eventually be changed to do so, causing serious bugs or performance issues if the developer doesn't recognize the implications of not doing so. Technically there is a performance hit by using useCallback, as you would be creating and additional function but it is negligible compared to the re-declaration of the function that always has to happen either you use useCallback or not and the overall footprint of React and JavaScript. So, if you are really concerned about the performance impact of useCallback versus not using it, you should be questioning yourself if React is the right tool for the job.

2 of 5
20

You can place functions inside stateless functional components:

function Action() {
    function handlePick(){
        alert("test");
    }

    return (
        <div>
            <input type="button" onClick={handlePick} value="What you want to do ?" />
        </div>
    )
}

But it's not a good practice as the function handlePick() will be defined every time the component is rendered.

It would be better to define the function outside the component:

function handlePick(){
    alert("test");
}

function Action() {
    return (
        <div>
            <input type="button" onClick={handlePick} value="What you want to do ?" />
        </div>
    )
}
🌐
Reddit
reddit.com › r/reactjs › please say "function component" instead of "functional component"
r/reactjs on Reddit: Please say "Function Component" instead of "Functional Component"
December 20, 2022 -

I have seen this mistake for years and it really annoys me as it’s just wrong.

There is almost nothing functional in a react component besides some map functions.

For the sake of good vocabulary usage say "Function Component", because it’s a component made by a function instead previously by classes.

Here are the official docs:

https://reactjs.org/docs/components-and-props.html

Peace ✌️

🌐
Kent C. Dodds
kentcdodds.com › blog › dont-call-a-react-function-component
Don't call a React function component
December 8, 2019 - Based on our refactor, we've come to realize that the "given component" for all our useState calls is not the App and Counter, but the App alone. This is due to the way we're calling our Counter function component. It's not a component at all, but a function. React doesn't know the difference between us calling a function in our JSX and inlining it.
🌐
React Native
reactnative.dev › docs › intro-react
React Fundamentals · React Native
February 20, 2026 - Here is how you do it: To define ... Component: ... You can think of components as blueprints. Whatever a function component returns is rendered as a React element....
🌐
freeCodeCamp
freecodecamp.org › news › function-component-vs-class-component-in-react
Function Components vs Class Components in React – With Examples
April 16, 2024 - They can accept inputs called props (short for properties) and return React elements describing what should appear on the screen. ... Function Components: These are simple JavaScript functions that take props as input and return JSX elements.
🌐
Upgrad
upgrad.com › home › blog › software development › react functional components with examples [in-depth guide]
React Functional Components: In-Depth and Detailed Guide | upGrad blog
April 15, 2025 - In other words, functional components accept data, or more technically, it takes props as a function argument and returns the data in valid JSX form. Below is the example for a react functional component props as an argument and returns the support in the valid JSX form.
🌐
DhiWise
dhiwise.com › post › react-function-components-and-typescript-mastering-the-advanced-techniques
React Function Components and Advanced TypeScript Techniques
April 30, 2025 - These are a type of component in the React JavaScript library that allow developers to create reusable pieces of code to build user interfaces. They are defined as plain JavaScript functions that return a React element or JSX (a syntax extension ...
🌐
DEV Community
dev.to › ugglr › react-functional-components-const-vs-function-2kj9
React functional components: const vs. function - DEV Community
July 7, 2020 - // Components are hoisted to the top. function MyComponent() {} function AlsoMyComponent() {} const App = () => ( <> <MyComponent /> <AlsoMyComponent /> </> ) // I like to keep my components at the bottom 👀 where did they go? ... That's it! I think...? If you have a different idea then me, or know more differences please let me know! ... Thanks, this is a really helpful, succinct, well written article. ... Msc. Electrical Engineering: Design of Processors and Integrated Systems. ... 💻 Front-end developer 🔥 React Guru 🌟 Always hungry to learn 🚀 Always striving for excellence 💡 Bringing new ideas to the table 🔧 Building beautiful, user-friendly interfaces 🤓
🌐
Next.js
nextjs.org › learn › react-foundations › building-ui-with-components
React Foundations: Building UI with Components | Next.js
Applications usually include more content than a single component. You can nest React components inside each other like you would regular HTML elements. In your example, create a new component called HomePage: ... function Header() { return <h1>Develop.
🌐
Plain English
plainenglish.io › home › blog › react › const vs. function for react functional components
Const vs. Function For React Functional Components
November 17, 2022 - (This resembles most of our use cases in React) Example showing how InnerComponent cannot be used before its initialization at runtime · If instead we move the AppEntry call up before InnerComponent, then we see the problem occurring because the const function expression is not being hoisted. (But I don’t think this will ever happen to you, since the entry point of your app is most likely in index.tsx and all other components will be imported above the initial render function) Lastly, if we use the function keyword instead to declare InnerComponent, then the hoisting kicks in, and it works as seen in the following screenshot.