# Param0

Parameter of a function are often passed wrapped into an object, React props is a notable example:

```typescript
function MyComponent(props: Props) {
	return <>...</>;
}
```

To extract `Props` you can use:

```typescript
import type { Param0 } from "tsafe";

type props = Param0<typeof MyComponent>;
```

It's kind of the same of doing:

```typescript
type props = Parameters<typeof MyComponent>[0];
```

but

```typescript
declare function fun(): number;

type FunParams = Param0<typeof fun>;
//   ^void (instead of never)
```

and

```typescript
declare function fun(params?: { foo: string }): void;

type FunParams = Param0<typeof fun>;
//   ^ { foo: string; } ( instead of { foo: string; } | undefined )
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tsafe.dev/param0.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
