Answer the question
In order to leave comments, you need to log in
How in my case to synchronize the display of the client with the markup of the server (SSR)?
Good day . I was tormented, but still I was able to server side render my react application.
Outcome The server issues the markup with the data. But there is a nuisance, a damn example is needed here, but I will try to explain my problem by applying screenshots.
const App = () => {
const dispatch = useDispatch();
const { key } = useLocation();
const [categories, error] = useSSE(async () => {
const response = await Api.getAllCategory();
const tests = await response.json();
return tests.map(({ id, categoryName, link, tests }) => {
return { id, categoryName, link, tests };
});
}, []);
server
.disable("x-powered-by")
.use(express.static(process.env.RAZZLE_PUBLIC_DIR)) // use env razzle public directory
.get("/*", async (req, res) => {
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question