# Expo Router

MuxForms on Expo Router uses a contact screen that POSTs JSON to the submit API with field names matching your dashboard schema. Pair with a website embed using the same form id for unified support intake.

## Expo Router

| File | Role |
| --- | --- |
| app/contact.tsx | Form UI + submit |
| app.json extra | Public form id only |
| Secret | Server or EAS secret—not in git |
| platform field | ios | android in JSON |

## app/contact.tsx

```
import { useState } from "react";
import { View, TextInput, Button, Alert } from "react-native";

const FORM_ID = "FORM_UUID";

export default function ContactScreen() {
  const [email, setEmail] = useState("");
  const [message, setMessage] = useState("");

  async function onSubmit() {
    const res = await fetch(`https://www.muxforms.com/api/v1/forms/${FORM_ID}/submit`, {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ email, message, platform: "expo", _hp: "" }),
    });
    if (!res.ok) {
      Alert.alert("Could not send", "Try again or email support.");
      return;
    }
    Alert.alert("Sent", "We will reply soon.");
  }

  return (
    <View style={{ padding: 16, gap: 12 }}>
      <TextInput placeholder="Email" autoCapitalize="none" value={email} onChangeText={setEmail} />
      <TextInput placeholder="Message" multiline value={message} onChangeText={setMessage} />
      <Button title="Send" onPress={onSubmit} />
    </View>
  );
}
```

## Production auth

The sample omits Authorization for local schema testing. Production apps should attach the ingest secret from a secure proxy—see /docs/api.

## FAQ

### React Native doc overlap?

Same API; Expo Router shows file placement.

### Server routes in Expo?

Use API routes or edge function to hold ingest secret.

### Web export?

Expo web can use embed.js instead—see /docs/html.

### Deep link to contact?

expo-router Link href=/contact works unchanged.

---

HTML version: https://www.muxforms.com/docs/expo-router
Source: MuxForms (https://www.muxforms.com)
