CJY0208 / react-activation

Hack <KeepAlive /> for React
https://www.npmjs.com/package/react-activation
MIT License
1.81k stars 141 forks source link

App.tsx:140 Uncaught TypeError: getCachingNodes is not a function #325

Open vaynevayne opened 2 months ago

vaynevayne commented 2 months ago

getCachingNodes is not a function TypeError: getCachingNodes is not a function

const { dropScope, clear, getCachingNodes } = useAliveController()

    useEffect(() => {
      console.log('prevPathname', prevPathname)

      const toChild = location.pathname.startsWith(prevPathname || '')
      console.log('toChild', toChild)
      const cachingNodes = getCachingNodes()
      console.log('cachingNodes', cachingNodes)
      if (!toChild) {
        if (cachingNodes.some(node => node.name === prevPathname)) {
          const reg = `${prevPathname}`
          console.log('reg', reg)

          dropScope(new RegExp(reg))
        }
      }
    }, [location.pathname])