Git Product home page Git Product logo

Comments (4)

aappddeevv avatar aappddeevv commented on July 24, 2024

That's very cool. If its working well, how are you trying to improve this?

My apologies if I took over that other issue and made it noisy so that the original intent was lost.

It is my belief that part of the interop issues have to do with how the Backend, Props and State are wrapped in scalajs-react. In the above, you are gluing constructor arguments directly into the actual object so you are essentially just using a js API with scala that looks like it is directly manipulating the js constructs using scala methods. This looks like it allows you to use the js react component in scalajs-react. However, depending on what components you define in scalajs-react, this may or may not allow you to get some of the features of component composition e.g. the values on property objects defined in scala typed property objects, in these components.

I'm just thinking through this myself to ensure that the expanding universe of js react components are available to us as seamlessly as possibly because there are alot of goods ones out there.

from scalajs-react.

japgolly avatar japgolly commented on July 24, 2024

The way you're doing it now is (generally) the best way that I can think of for now. It would be nice to reduce some of the verbosity. I was thinking the other day the scala.js pickling lib might offer something but I haven't really thought about it yet.

This highlights an important distinction. There's creating Scala components in React (which is what the library is primarily focussed on so far), and then there's wrapping JS components. JS component support is something I haven't given much attention to yet. By all means do suggest ways to improve this.

Composition of the two types should be fine with the exceptions of property and/or "backend" inheritance, and components just expecting other components to expose functions. I don't think either of those scenarios are desirable anyway. On the other hand if there's some awesome JS React component and it needs something like that.... Well, let's see how it goes. Please keep sharing problem scenarios and ideas.

from scalajs-react.

dispalt avatar dispalt commented on July 24, 2024

Gotcha, thanks so much.

from scalajs-react.

japgolly avatar japgolly commented on July 24, 2024

No worries. Good luck, dude!

from scalajs-react.

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.