# Prop

Props are used when you want to receive data from parent components.

This is how to use prop in Vucript.

```typescript
const propName:prop<type> = defaultValue;
const propName:prop<type>;//this transforms to required prop
```

### Example

```typescript
const msg:prop<String> = 'default message';
const requiredNumberValue:prop<Number>;
```

This code is compiled to

```typescript
import { defineComponent, toRefs } from "vue";
export default defineComponent({
  props: {
    msg: { type: String, required: false, default: "default message" },
    requiredNumberValue: { type: Number, required: true },
  },
  setup(props) {
    const { msg, requiredNumberValue } = toRefs(props);
    return {};
  },
})
```
