# ExpoGreeterModule

Defined in: [ExpoGreeterModule.ts:10](<https://github.com/RasmusKard/rn-cross-platform-docs/blob/0da3d0d857eb42221729c0daeb24d322590b94e4/examples/expo-greeter/src/ExpoGreeterModule.ts#L10>)

The native module's API, available as the package's default export.

Listen to its events with `useEvent(ExpoGreeter, 'onChange')` from `expo`, or with `addListener`.

**Extends**

- `NativeModule`\<[`ExpoGreeterModuleEvents`](<https://rasmuskard.github.io/rn-cross-platform-docs/typescript/type-aliases/ExpoGreeterModuleEvents/index.md>)\>

## Properties

### defaultName

> **defaultName**: `string`

Defined in: [ExpoGreeterModule.ts:12](<https://github.com/RasmusKard/rn-cross-platform-docs/blob/0da3d0d857eb42221729c0daeb24d322590b94e4/examples/expo-greeter/src/ExpoGreeterModule.ts#L12>)

The name [`hello`](<#hello>) greets when [`options.name`](<https://rasmuskard.github.io/rn-cross-platform-docs/typescript/type-aliases/GreetingOptions/index.md#name>) is not given: `"world"`.

## Methods

### hello()

> **hello**(`options?`): `string`

Defined in: [ExpoGreeterModule.ts:25](<https://github.com/RasmusKard/rn-cross-platform-docs/blob/0da3d0d857eb42221729c0daeb24d322590b94e4/examples/expo-greeter/src/ExpoGreeterModule.ts#L25>)

Builds a greeting.

**Parameters**

**`options?`**

[`GreetingOptions`](<https://rasmuskard.github.io/rn-cross-platform-docs/typescript/type-aliases/GreetingOptions/index.md>)

Who to greet and how; omitted fields take their defaults.

**Returns**

`string`

The greeting, e.g. `"Hello, world."`.

**Example**

```ts
ExpoGreeter.hello({ name: 'Ada', excited: true }); // "Hello, Ada!"
```

---

### setValueAsync()

> **setValueAsync**(`value`): `Promise`\<`void`\>

Defined in: [ExpoGreeterModule.ts:28](<https://github.com/RasmusKard/rn-cross-platform-docs/blob/0da3d0d857eb42221729c0daeb24d322590b94e4/examples/expo-greeter/src/ExpoGreeterModule.ts#L28>)

Emits [`onChange`](<https://rasmuskard.github.io/rn-cross-platform-docs/typescript/type-aliases/ExpoGreeterModuleEvents/index.md#onchange>) with `value`.

**Parameters**

**`value`**

`string`

**Returns**

`Promise`\<`void`\>
