Skip to content

Commit db11fe8

Browse files
committed
try another approach
1 parent a2c2c72 commit db11fe8

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

packages/react-router/src/server/instrumentation/reactRouter.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,12 @@ export class ReactRouterInstrumentation extends InstrumentationBase<Instrumentat
3737
COMPONENT,
3838
supportedVersions,
3939
(moduleExports: ReactRouterModuleExports) => {
40-
if (isWrapped(moduleExports['createRequestHandler'])) {
41-
this._unwrap(moduleExports, 'createRequestHandler');
42-
}
43-
this._wrap(moduleExports, 'createRequestHandler', _patchCreateRequestHandler);
44-
return moduleExports;
45-
},
46-
(moduleExports: ReactRouterModuleExports) => {
47-
this._unwrap(moduleExports, 'createRequestHandler');
40+
const { createRequestHandler, ...rest } = moduleExports;
41+
42+
return {
43+
...rest,
44+
createRequestHandler: _patchCreateRequestHandler(createRequestHandler),
45+
};
4846
},
4947
);
5048

0 commit comments

Comments
 (0)