From fcb94dce05526927c912f55184d9db72c88c331f Mon Sep 17 00:00:00 2001 From: "j.dev" Date: Fri, 27 Sep 2024 11:38:57 -0700 Subject: [PATCH] chore(3877): fix readonly type conflicts with Valtio --- app/components/billing/PublicCloudBillingInfo.tsx | 15 ++++++--------- app/components/billing/types.ts | 2 +- app/helpers/valtio.tsx | 5 ++--- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/app/components/billing/PublicCloudBillingInfo.tsx b/app/components/billing/PublicCloudBillingInfo.tsx index 5575fb326..048a89617 100644 --- a/app/components/billing/PublicCloudBillingInfo.tsx +++ b/app/components/billing/PublicCloudBillingInfo.tsx @@ -15,15 +15,12 @@ export default function PublicCloudBillingInfo({ product, className, }: { - product: Omit< - Product & { - _permissions?: { - signMou: boolean; - reviewMou: boolean; - }; - }, - 'providerSelectionReasons' | 'providerSelectionReasonsNote' - >; + product: Product & { + _permissions?: { + signMou: boolean; + reviewMou: boolean; + }; + }; className?: string; }) { const { data: session } = useSession(); diff --git a/app/components/billing/types.ts b/app/components/billing/types.ts index 8051a5f26..e49155f70 100644 --- a/app/components/billing/types.ts +++ b/app/components/billing/types.ts @@ -12,5 +12,5 @@ export type Product = Omit< }; }; }>, - 'updatedAt' | 'providerSelectionReasons' | 'providerSelectionReasonsNote' + 'updatedAt' >; diff --git a/app/helpers/valtio.tsx b/app/helpers/valtio.tsx index 8c1e0ecd4..885a28a51 100644 --- a/app/helpers/valtio.tsx +++ b/app/helpers/valtio.tsx @@ -1,6 +1,5 @@ import { createContext, useContext, useRef } from 'react'; import { proxy, useSnapshot } from 'valtio'; -import type { Snapshot } from 'valtio/vanilla'; export function createValtioContext(initialState: T) { const StateContext = createContext(initialState); @@ -24,7 +23,7 @@ export function createGlobalValtio(initialState: T) { const useValtioState = function useValtioState() { const snapshot = useSnapshot(state); - return [state, snapshot] as [T, Snapshot]; + return [state, snapshot]; }; return { state, useValtioState }; @@ -33,5 +32,5 @@ export function createGlobalValtio(initialState: T) { export function useValtio(data: T) { const state = useRef(proxy(data)).current; const snapshot = useSnapshot(state); - return [state, snapshot] as [T, Snapshot]; + return [state, snapshot]; }