Giter Club home page Giter Club logo

Comments (4)

namadnuno avatar namadnuno commented on May 29, 2024 2

Really cool! It works well! Thank you! 🎉! You can close this issue now!

from composition-api.

danielroe avatar danielroe commented on May 29, 2024 1

@namadnuno Thanks for the report and kind words 😃

The warning is not something to worry about, although suggestions/help are welcome as far as getting rid of it. (I've created #19 to track.)

As far as the mismatch is concerned, fetch() in Nuxt 2.12+ only looks after the component state (which in this context is what is returned from setup()). So this would work:

{
  setup() {
    const post = ref(null)

    async function loadPost() {
      ...
    }

    useFetch(async () => {
      await loadPost();
    })

    return { post }
  }
}

For improved composability (given that a lot of state is stored off-component with the Composition API), I plan to create a ssrRef function that will automatically stringify and rehydrate refs on client-side, independent of component context. #20

from composition-api.

namadnuno avatar namadnuno commented on May 29, 2024

Thanks a lot for answering 👍, I will keep it into consideration, and will wait until those are implemented!

from composition-api.

danielroe avatar danielroe commented on May 29, 2024

@namadnuno Fingers crossed, if you use ssrRef for your state, everything should now work. I'll wait to hear back before closing the issue though.

from composition-api.

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.