diff --git a/docs/docs/api-files-gatsby-ssr.md b/docs/docs/api-files-gatsby-ssr.md index dce72f9..902ca99 100644 --- a/docs/docs/api-files-gatsby-ssr.md +++ b/docs/docs/api-files-gatsby-ssr.md @@ -2,22 +2,24 @@ title: The gatsby-ssr.js API file --- -The file `gatsby-ssr.js` lets you alter the content of static HTML files as they are being Server-Side Rendered (SSR) by Gatsby and Node.js. To use the [Gatsby SSR APIs](/docs/ssr-apis/), create a file called `gatsby-ssr.js` in the root of your site. Export any of the APIs you wish to use in this file. +फ़ाइल `gatsby-ssr.js` आपको स्थिर HTML फ़ाइलों की सामग्री को बदलने देती है क्योंकि वे Gatsby और Node.js. द्वारा सर्वर-साइड रेंडर (SSR) की जा रही हैं। [Gatsby SSR APIs](/docs/ssr-apis/) का उपयोग करने के लिए, अपनी साइट की जड़ में gatsby-ssr.js नामक एक फ़ाइल बनाएँ। इस फ़ाइल में आपके द्वारा उपयोग किए जाने वाले किसी भी API को निर्यात करें। -The APIs `wrapPageElement` and `wrapRootElement` exist in both the SSR and [browser APIs](/docs/browser-apis). If you use one of them, consider if you should implement it in both `gatsby-ssr.js` and `gatsby-browser.js` so that pages generated through SSR with Node.js are the same after being [hydrated](/docs/glossary#hydration) with browser JavaScript. + +APIs `wrapPageElement` और `wrapRootElement` दोनों SSR और [browser APIs](/docs/browser-apis) में मौजूद हैं। +यदि आप उनमें से एक का उपयोग करते हैं, तो विचार करें कि क्या आपको इसे `gatsby-ssr.js` और `gatsby-browser.js` दोनों में लागू करना चाहिए ताकि Node.js के साथ SSR के माध्यम से उत्पन्न पेजेज़ जावास्क्रिप्ट से [hydrated](/docs/glossary#hydration) होने के बाद समान हों। ```jsx:title=gatsby-ssr.js const React = require("react") const Layout = require("./src/components/layout") -// Adds a class name to the body element +// body element के लिए एक class name जोड़ता है exports.onRenderBody = ({ setBodyAttributes }, pluginOptions) => { setBodyAttributes({ className: "my-body-class", }) } -// Wraps every page in a component +// प्रत्येक पृष्ठ को एक कौम्पोनॅन्टस में लपेटता है exports.wrapPageElement = ({ element, props }) => { return {element} }