MiteSDK

Components Reference

All React Native components exported by the Mite SDK.

Every component must be rendered inside a MiteProvider. All of them ship with sensible default styling and need no configuration to work.

ComponentPurpose
MiteProviderProvide the Mite instance to the tree
ShakeToReportFull in-app bug reporting flow
ScreenshotAnnotatorDraw on and redact an image
WhatsNewRelease notes after an update
AnnouncementPopupShow-once announcement popup
FeatureRequestsSheetFeature request board
StoreReviewPromptReview deflection prompt
MiteErrorBoundarySend render errors to Mite and show a fallback

MiteProvider

Makes a Mite instance available to hooks and components.

<MiteProvider client={mite}>
  {/* Your app */}
</MiteProvider>
PropTypeDescription
clientMiteThe instance to provide. Required
childrenReact.ReactNodeYour app

miteInstance is the 1.0 name for client. It still works, is deprecated, and is removed in 2.0. Pass one or the other, not both.

ShakeToReport

In-app bug reporting: shake or tap to open, capture a screenshot, annotate, submit. Mount once. See In-App Bug Reporting.

<ShakeToReport showFloatingButton onSubmitted={r => console.log(r.id)} />
PropTypeDefaultDescription
shakeEnabledbooleantrueListen for shake gestures. Needs expo-sensors
showFloatingButtonbooleanfalseRender a floating bug button
screenshotEnabledbooleantrueCapture a screenshot. Needs react-native-view-shot
shakeOptionsShakeDetectorOptions—Sensitivity and timing overrides
onSubmitted(response: SubmitBugReportResponse) => void—Successful submission
onError(error: Error) => void—Submission failure
onQuotaExceeded(refusal: MiteQuotaRefusal) => void—Account over a plan limit
quotaMessagestring'Reports are not being accepted right now. Please try again later.'Text shown to the user on a refusal

ScreenshotAnnotator

Full-screen image editor with a pen tool and a redaction rectangle tool.

<ScreenshotAnnotator
  imageUri={uri}
  onDone={annotatedUri => setAttachment(annotatedUri)}
  onCancel={() => setEditing(false)}
/>
PropTypeDescription
imageUristringImage to annotate. Required
onDone(annotatedUri: string) => voidCalled with the flattened result. Required
onCancel() => voidCalled when the user backs out. Required

WhatsNew

Shows release notes once per new app version. Mount once. See What's New.

<WhatsNew showOnFirstLaunch title="Latest updates" />

Accepts every useWhatsNew option plus:

PropTypeDefaultDescription
titlestring"What's New"Sheet heading
dismissLabelstring'Got it'Dismiss button label
onDismiss() => void—Called after dismissal

Follows the system color scheme. Open it imperatively with showWhatsNew().

AnnouncementPopup

Shows the latest active announcement once per device. Mount once. See Announcements.

<AnnouncementPopup onCtaPress={url => track('announcement_cta', { url })} />

Accepts every useAnnouncementPopup option plus:

PropTypeDefaultDescription
dismissLabelstring'Got it'Dismiss button label
onDismiss() => void—Called after dismissal
onCtaPress(url: string) => void—Called before the action URL opens

Follows the system color scheme. Open it imperatively with showAnnouncement().

FeatureRequestsSheet

Wraps any element as a trigger that opens the feature request board. See Feature Requests.

<FeatureRequestsSheet>
  <Text>Request a feature</Text>
</FeatureRequestsSheet>
PropTypeDefaultDescription
childrenReactNode—Trigger element
titlestring'Feature requests'Sheet heading
accentColorstring#0a7ea4Vote and submit button color
onSubmitted(featureRequestId: string) => void—Successful submission

The board is fetched lazily when the sheet opens.

StoreReviewPrompt

Asks "Enjoying the app?" and routes the answer. See Store Review Prompt.

<StoreReviewPrompt visible={visible} onClose={() => setVisible(false)} />
PropTypeDefault
visibleboolean—
onClose() => void—
titlestring'Enjoying the app?'
messagestring'Your feedback helps us improve.'
positiveTextstring'Yes, I love it!'
negativeTextstring'Not really'
feedbackTitlestring'What could be better?'
feedbackPlaceholderstring'Tell us what went wrong...'
feedbackSubmitTextstring'Send feedback'
dismissTextstring'Not now'
feedbackReportTitlestring'In-app feedback'
onPositive(reviewRequested: boolean) => void—
onNegative() => void—
onFeedbackSubmitted(response: SubmitBugReportResponse) => void—
onQuotaExceeded(refusal: MiteQuotaRefusal) => void—
quotaMessagestring'Feedback is not being accepted right now. Please try again later.'

Providing onNegative skips the built-in feedback step.

MiteErrorBoundary

Catches render errors below it, sends each one to Mite with its component stack, and renders fallback in place of a blank screen. See Error Tracking.

<MiteErrorBoundary fallback={({ reset }) => <Retry onPress={reset} />}>
  <App />
</MiteErrorBoundary>
PropTypeDefaultDescription
childrenReactNode—The tree to guard
fallbackReactNode | (props: { error: unknown; reset: () => void }) => ReactNodenullWhat to render after a child throws. reset renders the children again
onError(error: unknown, info: ErrorInfo) => void—Called after the error is sent to Mite

The error is sent as unhandled. Mite sends it only when a Mite instance has an apiKey and error tracking is on.

On this page