gatsby

Reduce initial server response time with Netlify and Gatsby

帅比萌擦擦* 提交于 2021-02-05 12:15:22
问题 I'm running PageSpeed Insights on my website and one big error that I get sometimes is Reduce initial server response time Keep the server response time for the main document short because all other requests depend on it. Learn more. React If you are server-side rendering any React components, consider using renderToNodeStream() or renderToStaticNodeStream() to allow the client to receive and hydrate different parts of the markup instead of all at once. Learn more. I looked up

Mapping array of images leads to the same image repeating on every instance

这一生的挚爱 提交于 2021-02-05 11:34:50
问题 Im trying to map an object from an array of arrayed images into an image gallery on separate product pages (coming from strapi). The correct number of images appear but it repeats the same image over them. Even on product pages that shouldn't include that image in their respective array. examples - https://imgur.com/a/PKlpofy Ive checked the source and the image src links are all different versions of the same image. - https://imgur.com/a/968w77b GraphIQL - https://imgur.com/a/HvgMA8r Any

Mapping array of images leads to the same image repeating on every instance

混江龙づ霸主 提交于 2021-02-05 11:34:50
问题 Im trying to map an object from an array of arrayed images into an image gallery on separate product pages (coming from strapi). The correct number of images appear but it repeats the same image over them. Even on product pages that shouldn't include that image in their respective array. examples - https://imgur.com/a/PKlpofy Ive checked the source and the image src links are all different versions of the same image. - https://imgur.com/a/968w77b GraphIQL - https://imgur.com/a/HvgMA8r Any

warning 'ScrollingHorizontally' is defined but never used no-unused-vars

别等时光非礼了梦想. 提交于 2021-02-05 08:44:47
问题 Can someone please help explain this error? I have tried a few different ways to write the React.Component. Is there something missing? Error: 4:7 warning 'ScrollingHorizontally' is defined but never used no-unused-vars Component: import React, { Component } from 'react' import HorizontalScroll from 'react-scroll-horizontal' class ScrollingHorizontally extends Component { render() { const child = { width: `30em`, height: `100%`} const parent = { width: `60em`, height: `100%`} return ( <div

Speed Up Gatsby Performance

∥☆過路亽.° 提交于 2021-02-05 08:01:11
问题 I was given a task at work to increase the performance of my project. Currently, the Google Lighthouse score fluctuates but overall it's not that great of a score so we are trying to figure out how to increase its performance to be able to show off to our leadership. Our project loads the entirety of the Gatsby site as a single JavaScript bundle. This creates a single page application from the site, which allows new pages to load quickly via JavaScript. But with something as large as our

Speed Up Gatsby Performance

二次信任 提交于 2021-02-05 08:00:30
问题 I was given a task at work to increase the performance of my project. Currently, the Google Lighthouse score fluctuates but overall it's not that great of a score so we are trying to figure out how to increase its performance to be able to show off to our leadership. Our project loads the entirety of the Gatsby site as a single JavaScript bundle. This creates a single page application from the site, which allows new pages to load quickly via JavaScript. But with something as large as our

How to query multiple images in Gatsby from Strapi using Graphql

旧街凉风 提交于 2021-02-04 08:10:30
问题 I have set up a multiple media(images) field called pictures on my project content type on Strapi and I have added 2 projects with pictures containing 4 images each. I want to query these images in Gatsby using Graphql. This is my plugins array in gatsby-config.js plugins: [ `gatsby-plugin-react-helmet`, { resolve: `gatsby-source-filesystem`, options: { name: `images`, path: `${__dirname}/src/images`, }, }, `gatsby-plugin-sharp`, `gatsby-transformer-sharp`, { resolve: `gatsby-plugin-manifest`

Sanitizers VS dangerouslySetInnerHtml

余生长醉 提交于 2021-01-29 20:50:48
问题 According to some React documentation: Improper use of the innerHTML can open you up to a cross-site scripting (XSS) attack. Sanitizing user input for display is notoriously error-prone, and failure to properly sanitize is one of the leading causes of web vulnerabilities on the internet. It seems that improper usage of the sanitizers and the innerHTML can expose the site XSS (Cross-Site Scripting) attacks. On the other hand, according to other documentation (such as Gatsby or sanitizers

On Gatsby CMS how can i set the about page as a index page

£可爱£侵袭症+ 提交于 2021-01-29 09:53:44
问题 Hi I installed the gatsby cms starter with netlify, this project came with a started template called kaldi that have a basic post and pages, is easy to create fields and build the grapql data, but Im confuse the way that the route works, for example I can`t found the way to put the abot page as a index page this the index page that came ith the data info from the post fields import React from 'react' import PropTypes from 'prop-types' import { Link, graphql } from 'gatsby' import Layout from

Error: Invariant Violation: gatsby-source-graphql requires option `typeName` to be specified

橙三吉。 提交于 2021-01-29 07:31:45
问题 I am new to GatsbyJs - GraphQL, I have been exploring the example provided by gatsby(https://github.com/gatsbyjs/gatsby/tree/master/examples/using-gatsby-source-graphql), As I tried with local apollo-grapql server, It returns data in the front-end, However it throws above error and blocks the build process, not sure what exactly is typeName I need to pass it in here? any help one this would be much appreciated. `gatsby-source-graphql`, { resolve: "gatsby-source-graphql", options: { // This