小编lik*_*who的帖子

类型错误:prevDeps.join 不是 next js 的函数

我想在下一个 js 和 firebase 中创建一个搜索栏,它的工作原理是从 url 获取 slug 并通过我的搜索算法解析它。问题是,如果用户使用搜索栏 2 次,它就会中断并显示以下错误:

在此输入图像描述

这就是我推送数据的方式

              <Link  href={`http://localhost:3000/search/${search}/`} >
                <Magnify fontSize='small' />
              </Link>
Run Code Online (Sandbox Code Playgroud)

这是我得到它的方法

   const serachId = router.query.id;
    useEffect(() => {
        onAuthStateChanged(auth, async (user) => {

            if (user) {
                // User is signed in, see docs for a list of available properties
                // https://firebase.google.com/docs/reference/js/firebase.User
                const places = query(collection(getFirestore(app), '/programs'))
                const querySnapshot = await getDocs(places)



                querySnapshot.docs.forEach(doc => {

                    if (JSON.stringify(doc.data()).includes(router.query.id)) {
                        let programObj = {
                            age: doc.data().price,
                            icon: doc.data().logo,
                            status: "software",
                            date: doc.data().start,
                            name: doc.data().name, …
Run Code Online (Sandbox Code Playgroud)

firebase reactjs next.js

2
推荐指数
1
解决办法
3445
查看次数

标签 统计

firebase ×1

next.js ×1

reactjs ×1