From 03d9fb5e2952197d3cfedad0f9590312448fe33d Mon Sep 17 00:00:00 2001 From: shangchen0531 <54564711+shangchen0531@users.noreply.github.com> Date: Tue, 31 Aug 2021 15:34:51 +0800 Subject: [PATCH] Chapter 14, error when fetching data in server-side: 'showError is not a function' Since 'showError' is the third parameter in function 'fetchData' of some components such as IssueList, there should be 'null' in the same place when passing cookie to the 'activeRoute.component.fetchData'. --- ui/server/render.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/server/render.jsx b/ui/server/render.jsx index f3e518c8..c8e39ff3 100644 --- a/ui/server/render.jsx +++ b/ui/server/render.jsx @@ -18,7 +18,7 @@ async function render(req, res) { const index = req.url.indexOf('?'); const search = index !== -1 ? req.url.substr(index) : null; initialData = await activeRoute.component - .fetchData(match, search, req.headers.cookie); + .fetchData(match, search, null, req.headers.cookie); } const userData = await Page.fetchData(req.headers.cookie);