/
kaws
/
ui-kit-ce
Обзор
Документация
Войти
/
kaws
/
ui-kit-ce
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
packages/theme/src/utils/stylerSync/context.ts
23 строки
646 B
Урядышев Павел Александрович
chore: устранены предупреждения eslint
25 июл 2025, 14:03
25 июл 2025, 14:03
1bad2f7
Код
Авторство
О чём код?
import * as React from 'react' import { StylerSyncContextValue } from './constants' const defaultContextValue: StylerSyncContextValue = { themeProviders: [], // eslint-disable-next-line @typescript-eslint/no-empty-function setThemeProviders: () => {}, // eslint-disable-next-line @typescript-eslint/no-empty-function changeCurrentTheme: () => {}, } export const StylerSyncContext = React.createContext<StylerSyncContextValue>(defaultContextValue) export const useStylerSyncContext = (): StylerSyncContextValue => { const ctx = React.useContext(StylerSyncContext) if (!ctx) { return defaultContextValue } return ctx }