The issue isn't when passing the function, it's when destructuring the props and providing a default function:

{ createCard = f => f }: dataFormProps

This code indicates that createCard should be a function which accepts a parameter and returns a value. Which it doesn't:

createCard: ()=>void

Make the default parameter match the signature:

{ createCard = () => {} }: dataFormProps
Answer from David on Stack Overflow
🌐
DEV Community
dev.to › lico › react-ts-dont-repeat-the-type-when-you-pass-functions-as-props-use-their-types-5h6h
React TS: Don't repeat the type when you pass functions as props, use their types. - DEV Community
August 21, 2022 - Don't repeat the type when you pass functions as props, use their types. Let's suppose, there is a component named 'SignUpForm'. export interface SignUpFormProps { onSubmit?: (values: { username: string; nickname: string; password: string; }) => void; } export const SignUpForm = ({ onSubmit }: SignUpFormProps) => { const [values, setValues] = useState({ username: "", nickname: "", password: "", }); const handleChange: React.ChangeEventHandler<HTMLInputElement> = (e) => { setValues((prevValues) => ({ ...prevValues, [e.target.name]: e.target.value, })); }; const handleSubmit: React.FormEventHand
Discussions

Pass function with parameters as prop
If: You’re passing a value to a component as a prop You’re passing a function to the same component as another prop The first value is only used to pass into the function Then you should probably remove the first prop and make the parent handle the value. Instead of this: Do this: handleEvent(foo)} /> The Child component doesn’t actually care about value, so it’s better to remove the prop altogether. More on reddit.com
🌐 r/reactjs
6
2
November 8, 2022
How to pass a function as a prop in React+Typescript?
How to pass a function as a prop in React+Typescript · Hi! I am a newbie in Typescript: changeuser prop throws me an error “Type ‘{ changeUser: () => void; }’ is not assignable to type ‘IntrinsicAttributes’.” Any ideas, how to fix it · This topic was automatically closed 91 days ... More on sitepoint.com
🌐 sitepoint.com
0
January 20, 2022
Passing a function as a prop to a Typescript React Functional Component
I have a functional component (written in Typescript) that needs to pass a handler function down to a child component. Here is a scaled down version of the parent function: type Props = { More on stackoverflow.com
🌐 stackoverflow.com
Function component props with typescript
Yes. Defining an interface separately, makes it reusable and easier to read and move. More on reddit.com
🌐 r/reactjs
18
3
January 18, 2023
🌐
Medium
soufiane-oucherrou.medium.com › how-pass-function-as-props-to-child-in-react-and-typescript-2fafafa6a945
How Pass Function as Props To Child in React and Typescript. | by Soufiane Oucherrou | Medium
October 25, 2020 - In the line 5 we created a function called displayArg take argument as string and void means nothing will return. If you notice on line 11, Typescript catch and error but why? In react it suppose to be okay but in typescript is not, well because ChildComp did not know anything about that there’s a props coming from app component, to fix that we have to tell type script that there’s a props coming with special structure.
🌐
Bobby Hadz
bobbyhadz.com › blog › react-typescript-pass-function-as-prop
How to pass Functions as Props in React TypeScript | bobbyhadz
February 29, 2024 - Define a type for the function property in the component's interface. Define the function in the parent component. Pass the function as a prop to the child component.
🌐
Pluralsight
pluralsight.com › tech insights & how-to guides › tech guides & tutorials
Passing Functions in React with TypeScript | Pluralsight
February 6, 2019 - As a sample reference, the ClickHandler prop function is currently set up to receive an event parameter of React.MouseEvent type that is applied to an HTMLButtonElement. Any time you click on an element in JavaScript with your mouse, it receives this event property by default. We won’t be needing it in our example. If you did need information about the mouse click event, this is how you would let TypeScript know about the type of event and the type of element that was clicked.
🌐
Reddit
reddit.com › r/reactjs › pass function with parameters as prop
r/reactjs on Reddit: Pass function with parameters as prop
November 8, 2022 -

export default function Child(props) {

const handleClick = () => {

//do something

const parentFunctionParam = props.parentFunctionParameter;

props.callParentFunction(parentFunctionParam);

}

return( <Button onClick={handleClick} />);

}

export default function Parent() {

const someFunction(someParam) => {

// do something

}

return (<Child callParentFunction= {()=> someFunction(someParam)} />);

}

So, as stated above I have one Parent component and a Child component. I need to pass a function as prop from Parent to Child. The function has some parameters, do I also need to pass the parameters explicitly as prop from Parent to Child?

🌐
DEV Community
dev.to › mconner89 › passing-props-in-react-using-typescript-20lm
Passing props in React using Typescript - DEV Community
November 4, 2020 - Lets assume you're trying to pass a series of props down to a lower component in react, you're not going to do any kind of destructuring, and you're not passing any objects. So calling the lower-level component might look something like this: ... To make TypeScript happy, we need to tell it what to expect on that props object.
Find elsewhere
🌐
Tutorialsinhand
tutorialsinhand.com › tutorials › reactjs-tutorial › react-with-typescript › passing-function-as-props-react.aspx
Passing function as props react typescript | passing method as props react - tutorialsinhand
Passing function as props react - Lets learn about passing method as props react & examples to pass function as props react class component, pass function as props react functional component.
🌐
SitePoint
sitepoint.com › javascript
How to pass a function as a prop in React+Typescript?
January 20, 2022 - Hi! I am a newbie in Typescript: changeuser prop throws me an error “Type ‘{ changeUser: () => void; }’ is not assignable to type ‘IntrinsicAttributes’.” Any ideas, how to fix it? const App = () => { const [user, setUs…
🌐
Codemzy
codemzy.com › blog › react-pass-function-as-prop
3 ways to pass a function as a prop in React - Codemzy's Blog
September 15, 2023 - Just pass the function name, so your component can call it when it is good and ready (and not a moment sooner!). Here's how you could useEffect to call the function when the component mounts. import React from 'react'; function ParentCompon...
🌐
Atomizedobjects
atomizedobjects.com › blog › react › how-to-pass-a-react-component-as-a-prop-in-typescript
How to pass a React component as a prop in TypeScript | Atomized Objects
January 28, 2022 - With these two changes we can now make use of this component in the same way we would with any other component, until it comes to passing in props to the functional component. In order to send props to the functional component it is time to make use of generic types(generics) within TypeScript.
🌐
CopyProgramming
copyprogramming.com › howto › passing-a-function-as-a-prop-to-a-typescript-react-functional-component
React TypeScript: Pass Function as Prop to Functional Components - React typescript pass function as prop to functional components
October 23, 2025 - The most straightforward approach ... it returns. When you pass a function as a prop, TypeScript ensures the function signature matches exactly what the child component expects, preventing runtime errors at compile time....
🌐
Webdevtutor
webdevtutor.net › blog › typescript-react-pass-function-as-prop
A Guide to Passing Functions as Props in TypeScript React
By explicitly specifying the types of the props, you can leverage TypeScript's static type-checking to catch potential issues during development. To pass a function as a prop in TypeScript, you need to define the type of the function prop in the component's prop interface.
🌐
React
react.dev › learn › passing-props-to-a-component
Passing Props to a Component – React
You can think of a component with a children prop as having a “hole” that can be “filled in” by its parent components with arbitrary JSX. You will often use the children prop for visual wrappers: panels, grids, etc. ... The Clock component below receives two props from its parent component: color and time. (The parent component’s code is omitted because it uses state, which we won’t dive into just yet.) ... export default function Clock({ color, time }) { return ( <h1 style={{ color: color }}> {time} </h1> ); }
🌐
Total TypeScript
totaltypescript.com › pass-component-as-prop-react
How to Pass a Component as a Prop in React | Total TypeScript
June 7, 2024 - Learn different ways to pass a component as a prop in React: passing JSX, using React.ComponentType, and using React.ElementType.
🌐
Carl Rippon
carlrippon.com › different-ways-to-strongly-type-function-component-props-with-typescript
Different ways to strongly-type function component props with TypeScript
April 7, 2020 - “FC” stands for Function Component, and it aliases a type called FunctionComponent. ... The FC type is used on the variable assigned to the arrow function. It is a generic type that we pass the components props type into.