简体   繁体   中英

How can you just get server side rendering result on nextjs?

提示:本站收集StackOverFlow近2千万问答,支持中英文搜索,鼠标放在语句上弹窗显示对应的参考中文或英文, 本站还提供   中文简体   中文繁体   中英对照 版本,有任何建议请联系yoyou2525@163.com。

In a api route of my nextjs server, I want to request the server itself for a page where it will perform validation and return the result(whether it's validate or not), and I'll do next step depending on the result.

I need this flow because I want to use same validation codes on both client side and server side, and the codes depend on hooks(like redux selector).

Is it possible? Or is there any work around to meet what I intend to do? I hope there is at least a way to redirect in component during server side rendering as workaround.

If it's possible, would there be a way for a nextjs to return just a simple text message as the page result? So I can easily see if validation has gone ok.

No answers.You can refer to the related questions on the right.
暂无
暂无

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2022 STACKOOM.COM