How to use 'getserversideprops typescript' in JavaScript

Every line of 'getserversideprops typescript' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
239value: function getInitialProps(_ref) {
240 var renderPage = _ref.renderPage,
241 req = _ref.req;
242 var deviceType = req.device.type === _constants__WEBPACK_IMPORTED_MODULE_12__["PHONE"] ? _constants__WEBPACK_IMPORTED_MODULE_12__["MOBILE"] : _constants__WEBPACK_IMPORTED_MODULE_12__["DESKTOP"];
243 var sheet = new styled_components__WEBPACK_IMPORTED_MODULE_8__["ServerStyleSheet"]();
244 var page = renderPage(function (App) {
245 return function (props) {
246 return sheet.collectStyles(react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(App, props));
247 };
248 });
249 var styleTags = sheet.getStyleElement();
250 return _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default()({}, page, {
251 styleTags: styleTags,
252 deviceType: deviceType
253 });
254}

Related snippets