diff --git a/src/__tests__/commands/__snapshots__/build.test.ts.snap b/src/__tests__/commands/__snapshots__/build.test.ts.snap
index a84d8ac0..12f5d63f 100644
--- a/src/__tests__/commands/__snapshots__/build.test.ts.snap
+++ b/src/__tests__/commands/__snapshots__/build.test.ts.snap
@@ -13282,7 +13282,7 @@ export const AnalyticsProvider = ({
return {children};
};
-export const useAnalytics = () => {
+export const useAnalytics = (): TypewriterSegmentClient | {} => {
const client = useContext(Context);
if (!client) {
console.error(
@@ -13293,9 +13293,8 @@ export const useAnalytics = () => {
// @ts-ignore
return {};
}
- return {
- ...client,
- };
+
+ return client;
};
"
diff --git a/src/languages/templates/typescript/react-native.hbs b/src/languages/templates/typescript/react-native.hbs
index ed21248a..52b13511 100644
--- a/src/languages/templates/typescript/react-native.hbs
+++ b/src/languages/templates/typescript/react-native.hbs
@@ -43,7 +43,7 @@ export const AnalyticsProvider = ({
return {children};
};
-export const useAnalytics = () => {
+export const useAnalytics = (): TypewriterSegmentClient | {} => {
const client = useContext(Context);
if (!client) {
console.error(
@@ -54,7 +54,6 @@ export const useAnalytics = () => {
// @ts-ignore
return {};
}
- return {
- ...client,
- };
+
+ return client;
};