Skip to content

Upgrade trouble #677

Answered by jkinley
jkinley asked this question in Q&A
Discussion options

You must be logged in to vote

Ok. So I managed to get it working again after a little refactoring. Hope this helps other people too. Please feel free to make any suggestions that you might have. Thanks!

import React from 'react';
import { useStaticQuery, graphql } from 'gatsby';
import Gallery from '@browniebroke/gatsby-image-gallery';

const Gallery1 = () => {
  const {gallery} = useStaticQuery(getGallery);
  const images = gallery.edges.map(({node}) => ({
    ...node.src.childImageSharp,
    caption: <p className="text-xl">{node.caption}</p>
  }));

  return (
    <section className="py-16">
      <div className="container mx-auto px-8 lg:px-24 xl:px-48">
          <Gallery images={images} title="Gallery 1" />
      </

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by browniebroke
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #676 on April 06, 2021 08:36.