Special Sponsor:PromptBuilder— Fast, consistent prompt creation powered by 1,000+ expert templates.
Make your Product visible here.Contact Us

Home/TypeScript Errors/TS2349

TS2349

This expression is not callable

TypeScript TS2349 fires when you try to call something as a function that TypeScript doesn't consider callable. The value's type doesn't include a call signature, so TypeScript can't allow you to invoke it with ().

Why This Happens

You're using () on something that isn't a function — a plain object, a non-function value, a type that includes both function and non-function possibilities, or you're calling a React component type instead of rendering it.

Code That Triggers TS2349

// TS2349 examples

const config = { port: 3000 };
config(); // Error: This expression is not callable. Type '{ port: number; }' has no call signatures

// Also common with conditional types
type MaybeFunc = string | (() => number);
declare const fn: MaybeFunc;
fn(); // Error: This expression is not callable
// (can't call something that might be a string)

// React — calling component as function
import MyComponent from './MyComponent';
MyComponent({ prop: "value" }); // TS2349
// Should be: <MyComponent prop="value" /> or React.createElement(MyComponent, ...)

How to Fix TS2349

Option 1: Check the type is callable before invoking

type MaybeFunc = string | (() => number);
declare const fn: MaybeFunc;
if (typeof fn === "function") {
  fn(); // OK — narrowed to function type
}

Option 2: Fix the type to be a function type

// If the variable should always be a function:
const handler: () => void = () => { console.log("clicked"); };
handler(); // OK

Option 3: Use React.createElement for programmatic component creation

import React from 'react';
import MyComponent from './MyComponent';
// Instead of MyComponent({ prop: "value" })
React.createElement(MyComponent, { prop: "value" });

Frequently Asked Questions — TS2349

What does TS2349 mean?

TS2349 means you're trying to call something that TypeScript doesn't know is a function. The value's type has no call signature. Either the type is wrong, or you're accidentally calling a non-function.

TS2349 on a union type — how to fix?

Use typeof to narrow the type before calling: if (typeof fn === 'function') { fn(); }. TypeScript can't call a union that includes non-function types without narrowing.

TS2349 with React components — how to fix?

Don't call React components as functions (Component()). Use JSX (<Component />) or React.createElement(Component, props). Calling as a function bypasses React's lifecycle management.

TS2349 after refactoring — how to diagnose?

Check if the variable that was previously a function is now typed as something else. A common cause is renaming a function import but leaving the old call, or a type narrowing that changed the expected type.

Can any type suppress TS2349?

Yes — (value as any)() suppresses it. But avoid this; instead find why the type lost its call signature and fix the root cause.

Convert JavaScript to TypeScript automatically

Paste your JS code and get type-annotated TypeScript — including fixes for common type errors — in seconds.

Try the converter →

Other TypeScript Errors

From the blog

View all →