OptiView Ads SDK for React Native
    Preparing search index...

    Function getReactVideoViewTag

    • Extract the react-native-video view tag from an event payload.

      Compatible with any rnv callback — pass the payload straight through: onLoad={(data) => setTag(getReactVideoViewTag(data))}. Returns undefined when the payload carries no usable target (non-numeric, non-finite, or missing), so callers can ignore malformed events.

      This is the supported way to obtain the view tag for createOptiViewAds: findNodeHandle(videoRef.current) throws for react-native-video v6, whose ref is an imperative-methods object, not a host component.

      Parameters

      Returns number | undefined

      The view tag, or undefined when the payload carries none.