Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How could I write plain React code in scala (without wrappers like scalajs-react or slinky)? #530

Open
gatisnolv opened this issue Apr 17, 2023 · 2 comments

Comments

@gatisnolv
Copy link

gatisnolv commented Apr 17, 2023

Hi, I was curious about trying to write 'straight up' React code in scala (apart from scalajs-react and slinky) and was looking to see if React itself could be found under the Distribution. I was able to find it, but only with some luck as I would have expected it to be named either 'react' or 'react-js' there keeping with the naming convention used there.

So why is it named 'react-is' and instead of 'react-js' ?

https://github.com/ScalablyTyped/Distribution/tree/master/r/react-is

P.S. I would have asked the question under the Distribution repo, but does not appear to have an 'Issues' tab.

@oyvindberg
Copy link
Collaborator

Hey there.

the npm package is called react, not react-js, so you can find it at https://github.com/ScalablyTyped/Distribution/tree/master/r/react.

You absolutely can do it, but it does require some boilerplate. Some years back I wrote a thin DSL on top of bare react, utilizing the types from typescript (as they were). You can find that boilerplate in dsl.scala in this commit

@gatisnolv
Copy link
Author

Hey, thanks for clarifying it for me as well as the helpful pointers.

In was partly confused by the alpha-numerical ordering of directories in GitHub where the 'react' directory comes after all of the 'react-something' directories and thus not seeing it due to the web ui's 1000 item limit. I also realize I made the mistake of not thoroughly looking around https://github.com/ScalablyTyped/Distribution/tree/master/r/react-is which would have made it clear this was not react itself, which I could have realized by looking at what the npm link points to.

I took the liberty of modifying the issue title to be more helpful for anyone looking in this direction.

@gatisnolv gatisnolv changed the title Why is react referred to as 'react-is' under Distribution How could I write plain React code in scala (without wrappers scala-js or slinky)? Apr 18, 2023
@gatisnolv gatisnolv changed the title How could I write plain React code in scala (without wrappers scala-js or slinky)? How could I write plain React code in scala (without wrappers like scala-js or slinky)? Apr 18, 2023
@gatisnolv gatisnolv changed the title How could I write plain React code in scala (without wrappers like scala-js or slinky)? How could I write plain React code in scala (without wrappers like scalajs-react or slinky)? Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants