useStore

useCtx hooks 返回的参数中,类型为 RetAtom 的值都无法直接使用,需要使用 useStore hooks 进行读取

type useStore<T> = (RetAtom<T>) => T
import { useCtx, useStore } from '@ray-js/ipc-player-integration';

export function Component() {

  const deviceId = '1234567890xxxxxx';
  const instance = useCtx({
    devId: deviceId
  })
  // 使用 useStore 读取 screenType
  const { screenType } = useStore({ screenType: instance.screenType });
}