0

I'm trying to make a function do debug recoil state. I'm copying the debug observer from recoil

import React, { useEffect } from 'react'
import { useRecoilSnapshot } from 'recoil'

function DebugObserver(): React.node {
    const snapshot = useRecoilSnapshot()
    useEffect(() => {
        console.debug('The following atoms were modified:')
        for (const node of snapshot.getNodes_UNSTABLE({ isModified: true })) {
            console.debug(node.key, snapshot.getLoadable(node))
        }
    }, [snapshot])

    return null
}
export default DebugObserver

got error name space React has no exported member 'node'

enter image description here

I also installed @types/react": "^17.0.20" already.

What am I missing ?

angry kiwi
  • 10,730
  • 26
  • 115
  • 161

1 Answers1

0

.ReactNode in of .node will do the job.

angry kiwi
  • 10,730
  • 26
  • 115
  • 161