ConstAccepts a flow object and optional event handler props. Under the hood, it creates a native view and subscribes to flow events.
The view is embedded in your React tree, so its lifecycle is controlled by
your app — not by the SDK. Event handlers still run (and their side effects
apply), but the boolean they return does NOT dismiss the embedded view: that
"close" flag only applies to the imperative view created via
createFlowView. To dismiss the embedded view, stop rendering it
(e.g. flip state in onCloseButtonPress):
const [visible, setVisible] = useState(true);
const onCloseButtonPress = useCallback(() => {
setVisible(false); // unmount to dismiss; return value is ignored here
}, []);
return visible ? (
<AdaptyFlowView flow={flow} onCloseButtonPress={onCloseButtonPress} />
) : null;
To learn which localization the view was actually rendered with, read
view.locale in onAppeared. It is the localization the view was actually
built with, which may differ from the one requested through params.locale
if it is not available in the flow:
<AdaptyFlowView
flow={flow}
params={{ locale: 'es' }}
onAppeared={view => setUiLocale(view.locale)}
/>
AdaptyFlowViewProps for available props
React component that renders a native flow view.