mirror of
https://github.com/langgenius/dify.git
synced 2026-02-09 23:20:12 -05:00
feat: init rsc support for translation (#30596)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
import { cache } from 'react'
|
||||
|
||||
export default <T>(defaultValue: T): [() => T, (v: T) => void] => {
|
||||
export function serverOnlyContext<T>(defaultValue: T): [() => T, (v: T) => void] {
|
||||
const getRef = cache(() => ({ current: defaultValue }))
|
||||
|
||||
const getValue = (): T => getRef().current
|
||||
|
||||
Reference in New Issue
Block a user