Giter VIP home page Giter VIP logo

Comments (5)

vingeraycn avatar vingeraycn commented on May 30, 2024 1

Hi @dbx834
Thanks for the detailed info, I'll take a look at the question later today

from ruuri.

vingeraycn avatar vingeraycn commented on May 30, 2024

Hi @dbx834
I pasted your code on Codesandbox but it doesn't reproduce your problem, am I missing some key information? If possible, can this issue be reproduced on Codesandbox? Thank u

from ruuri.

dbx834 avatar dbx834 commented on May 30, 2024

Thanks for checking it out. Your sandbox certainly is working. Yes I did miss some information. I didn't include the fact that I'm using preact (ref) and preact-compat(ref). My guess is that the distributed ES5 code doesn't have the proper references (to preact). This is not really the function of the wrapper, to be compatible with Preact. I'll go more into it and write again soon, and this time with a sandbox if there's still an error. I'll also write if I'm able to find a workaround.

from ruuri.

dbx834 avatar dbx834 commented on May 30, 2024

So, I was able to sort it out.

I use this gatsby plugin, which replaces or updates references to these react libraries with the appropriate preact libraries at runtime.

The issue, as I guessed, was because of this. Precisely – because at runtime a reference couldn't be found in the code. How I solved it was that I copied the files in your source folder and used them as the component instead of the packaged files. Then, I just added a reference to React in DraggableGrid.tsx and DraggableItem.tsx, and it works.

This is a weird, rare issue. Noting it for someone else who maybe up against it.

Thanks, once again, @vingeraycn!

from ruuri.

vingeraycn avatar vingeraycn commented on May 30, 2024

So, I was able to sort it out.

I use this gatsby plugin, which replaces or updates references to these react libraries with the appropriate preact libraries at runtime.

The issue, as I guessed, was because of this. Precisely – because at runtime a reference couldn't be found in the code. How I solved it was that I copied the files in your source folder and used them as the component instead of the packaged files. Then, I just added a reference to React in DraggableGrid.tsx and DraggableItem.tsx, and it works.

This is a weird, rare issue. Noting it for someone else who maybe up against it.

Thanks, once again, @vingeraycn!

I'm glad to see the progress of the problem. I think this may have something to do with the concept of ruuri. ruuri relies on React's runtime, but does not mix React when packaging, but chooses to rely on the React version of the user's current project. It was true that Preact was not considered at first, but thank you for exposing it. @dbx834

from ruuri.

Related Issues (10)

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.