Skip to content

Commit 474f5da

Browse files
committed
check if atom has onMount property before queueing processOnMount callback
1 parent 4a309e8 commit 474f5da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/vanilla/internals.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ const BUILDING_BLOCK_mountAtom: MountAtom = (store, atom) => {
837837
t: new Set(),
838838
}
839839
mountedMap.set(atom, mounted)
840-
if (isActuallyWritableAtom(atom)) {
840+
if (isActuallyWritableAtom(atom) && atom.onMount) {
841841
const processOnMount = () => {
842842
let isSync = true
843843
const setAtom = (...args: unknown[]) => {

0 commit comments

Comments
 (0)