@@ -33,7 +33,7 @@ const DEFAULT_OPTIONS: ReactNativeOptions = {
3333/**
3434 * Inits the SDK and returns the final options.
3535 */
36- function _init < O = ReactNativeOptions > ( passedOptions : O ) : O {
36+ export function init ( passedOptions : ReactNativeOptions ) : void {
3737 const reactNativeHub = new Hub ( undefined , new ReactNativeScope ( ) ) ;
3838 makeMain ( reactNativeHub ) ;
3939
@@ -102,39 +102,28 @@ function _init<O = ReactNativeOptions>(passedOptions: O): O {
102102 if ( getGlobalObject < any > ( ) . HermesInternal ) {
103103 getCurrentHub ( ) . setTag ( "hermes" , "true" ) ;
104104 }
105-
106- return options ;
107- }
108-
109- /**
110- * Inits the Sentry React Native SDK without any wrapping
111- */
112- export function init ( options : ReactNativeOptions ) : void {
113- _init ( options ) ;
114105}
115106
116107/**
117108 * Inits the Sentry React Native SDK with automatic instrumentation and wrapped features.
118109 */
119- export function initWith < P > (
110+ export function wrap < P > (
120111 RootComponent : React . ComponentType < P > ,
121- passedOptions : ReactNativeWrapperOptions
112+ options ? : ReactNativeWrapperOptions
122113) : React . ComponentType < P > {
123- const options = _init ( passedOptions ) ;
124-
125114 const tracingIntegration = getCurrentHub ( ) . getIntegration ( ReactNativeTracing ) ;
126115 if ( tracingIntegration ) {
127116 tracingIntegration . useAppStartWithProfiler = true ;
128117 }
129118
130119 const profilerProps = {
131- ...options . profilerProps ,
120+ ...( options ? .profilerProps ?? { } ) ,
132121 name : RootComponent . displayName ?? "Root" ,
133122 } ;
134123
135124 const RootApp : React . FC < P > = ( appProps ) => {
136125 return (
137- < TouchEventBoundary { ...options . touchEventBoundaryProps } >
126+ < TouchEventBoundary { ...( options ? .touchEventBoundaryProps ?? { } ) } >
138127 < ReactNativeProfiler { ...profilerProps } >
139128 < RootComponent { ...appProps } />
140129 </ ReactNativeProfiler >
0 commit comments