GithubHelp home page GithubHelp logo

Comments (5)

hdoro avatar hdoro commented on September 26, 2024 1

Thank you for reporting with so much context, @Christian-Garrison!

I tried reproducing your issue in this CodeSandbox, but it's rendering properly. I used the block content value and components object you provided, what else may I be missing?

Could you remix the example I shared and try to reproduce the problem, please? Thanks in advance 😀

from react-portabletext.

Christian-Garrison avatar Christian-Garrison commented on September 26, 2024 1

@hdoro This fixed the issue, looks like markDefs was only available via _rawBlockContent 👍🏼

query {
  sanitySiteSettings {
    _rawBlockContent
  }
}

from react-portabletext.

Christian-Garrison avatar Christian-Garrison commented on September 26, 2024

@hdoro Thanks for addressing the issue, I've remixed the CodeSandbox here with my use case. Seems to work properly as well.

I just attempted placing my data into a json file like I have in the CodeSandbox and it worked properly, however when sourcing the data (Sanity to Gatsby GraphQL) and passing it through to my component it sends all the blocks, but seems to be missing the markDefs. I looked in the GraphQL playground and the markDefs were not a query option available, should appear below list.

image

Notice the two console logs below for comparison.

CodeSandbox:

2: Object
_key: "f6bd276c19e2"
_type: "block"
children: Array(5)
markDefs: Array(2)
style: "normal"

Gatsby Application:

2:
children: (5) [{}, {}, {}, {}, {}]
list: null
style: "normal"
_key: "f6bd276c19e2"
_type: "block"
[[Prototype]]: Object

from react-portabletext.

Christian-Garrison avatar Christian-Garrison commented on September 26, 2024

Possibly related to this issue through gatsby-source-sanity

from react-portabletext.

rexxars avatar rexxars commented on September 26, 2024

Glad you figured this out!

from react-portabletext.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.