score:1
if you want ssr by query so you can populate head and other stuff directly in serverside, you need to make the query directly in you need to create the query inside the getinitialprops function like this :
page.getinitialprops = async ({
apolloclient, query, children, router, href
}) => {
const { data, error, loading } = await apolloclient.query({ query: livre_query, variables: { slug: query.titre } })
if (error) {
return <div>erreur</div>
}
return { data, error, loading }
}
Source: stackoverflow.com
Related Query
- React Server Side Rendering with Sass
- React Context not working with server side rendering
- How to deploy React App on production with Server Side Rendering
- React Router v5 accompanied with Code Splitting, and Data Prefetching with the use of Server Side Rendering
- React facebook share not working on open graph meta tags with server side rendering
- React code splitting and server side rendering with System.import or require.ensure
- React JS server side rendering with python
- How to do Server Side Rendering in React With React Loadable and Fetching Data for Components (Like Next.js)?
- React Server side rendering with Express - warning on the client checksum & Styling
- react server side rendering with client side routing
- React Server Side Rendering with expensive initial API call
- how to properly deal with window=undefined error in react server side rendering
- Server Side Rendering with React Router Dom getting error: Warning: React.createElement: type is invalid -- expected a string
- How to implement error boundary in react with server side rendering in nextjs?
- React Query with server side rendering using Next.js
- Window is not defined with Server Side Rendering React and Express
- Empty cache after server side rendering a request in isomorphic app using Apollo GraphQL and React
- Express server with React front end routing without server side rendering
- Include a third party script in a functional component of react with server side rendering
- Server side rendering with Webpack Express and React
- React server side rendering with backend requests
- Using momentjs with correct locale in React server side rendering
- passing down props with React server side rendering
- Rails 5 Redux React Server Side Rendering gives client side JavaScript warning 'Replacing React-rendered children with a new...'
- Adding server side rendering to an existing React site created with create-react-app
- React massive content and duplication with server side rendering
- React Server Side Rendering - how to render from the server with :productId params passed in?
- Converting existing Rails + React application to React on Rails with Server Side Rendering (SSR)
- Image is not loading in server side rendering with react
- React Redux Server Side Rendering with code splitting and injecting
More Query from same tag
- React server sending 4 requests every second to backend API
- npx create-react-app command does not work, returns ES module error instead
- reactjs 'this' context in a es6 class
- How can I apply styles online in React with Meteor?
- react-beautiful-dnd pull out the anonymous function from React Draggable component
- How to call UseEffect when data comes into material table?
- Persist data between two pages with Next.js
- How to get Latitude and Longitude from Django Location PointField
- How do I make a class component method accessible outside of the component in React and Typescript?
- How to export a variable after fetching data from API in reactjs?
- Call react hooks inside event handler
- cant reset input after setting value attribute in react js
- CORS issue in react app, can't upload images
- Make multiple pages in ReactJS without using react-dom-router
- React-Redux error Invalid prop `children` of type `object` supplied to `Provider`
- react-app-rewired customise default start url
- React js simple and light weight Date Picker
- Tracking page number in cursor based pagination with graphql cache in use
- Content inside html elements are rendered with a delay - ReactJS
- Need to render after the function is executed React js
- scaleY property not maintained properly for small screens
- 'Error' message: ''index' is defined but never used. (no-unused-vars)
- React component works fine, but attempting to use useMemo() results in an error
- e.target.href not working in firefox
- How can I replace bits or string with React component, react-router-dom Link or an anchor tag <a></a>
- How does React router works and what is the difference between <link> and<Route>
- Session timer in ReactJS
- Kendo UI Upload button
- Redux Thunk action with axios returning multiple values
- Invoked function from setTimeout shows incorrect React state