Open History to see the last commit
1'use client'
2import * as React from 'react'
3import type { QueryStrictModeValue } from './QueryStrictModeTypes'
4β
5const QueryStrictModeContext = React.createContext<QueryStrictModeValue | null>(
6 null,
7)
8β
9/**
10 * Reads the nearest `QueryStrictMode`.
11 * @returns The value of the nearest `QueryStrictMode`, or `null` outside of one.
12 */
13export const useQueryStrictMode = () => React.useContext(QueryStrictModeContext)
14β
15/**
16 * The Provider that `QueryStrictMode` uses to share its value with the hooks below it, read by
17 * `useQueryStrictMode`.
18 */
19export const QueryStrictModeProvider = QueryStrictModeContext.Provider