Skip to content

Commit 9efc506

Browse files
committed
wip: revert change with if condition
1 parent c653665 commit 9efc506

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/react/useAtomValue.ts

+8
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,14 @@ export function useAtomValue<Value>(atom: Atom<Value>, options?: Options) {
141141
useEffect(() => {
142142
const unsub = store.sub(atom, () => {
143143
if (typeof delay === 'number') {
144+
if (!ReactExports.use) {
145+
const value = store.get(atom)
146+
if (isPromiseLike(value)) {
147+
attachPromiseMeta(
148+
createContinuablePromise(value, () => store.get(atom)),
149+
)
150+
}
151+
}
144152
// delay rerendering to wait a promise possibly to resolve
145153
setTimeout(rerender, delay)
146154
return

0 commit comments

Comments
 (0)