Questions tagged [scalajs-react]

scalajs-react lifts Facebook's React library into Scala.js and endeavours to make it as type-safe and Scala-friendly as possible.

scalajs-react is a Scala.js library to levarage Facebook's React in Scala.js code. Is contains facade types for React and a Scala-friendly adapter around the virtual DOM.

https://japgolly.github.io/scalajs-react/

76 questions
18
votes
3 answers

Scalajs-react VS Xored Scalajs-react VS SRI

What is the difference between these Scala.js React.js libraries and why should I choose one over the other ? Xored Scalajs-react - Last commit was 8 months ago. So I'm guessing the development is not active anymore. Scalajs-react - Very active and…
user794783
  • 3,619
  • 7
  • 36
  • 58
4
votes
1 answer

Integrating Server-Side Rendering with scalajs-react

I've been trying to follow the guide of integrating server-side rendering in scalajs-react but my stack must be a little different so it's not so super straight-forward. I'm using SBT 1.5.5, scala 2.12.10 with the following relevant plugins: …
4
votes
0 answers

Scala macros. How to instantiate subclass and dynamically mixin trait

Motivation: (not tightly associated with this topic but states a use case. Skippable) I'm using Scala.js to write React code. I now have a form which contains bunch of inputs, each needs a onChange callback in its props. See Controlled…
cuz
  • 1,172
  • 11
  • 12
4
votes
1 answer

How to exclude javascript dependencies using the sbt-scalajs plugin in a scalajs-react project?

How to exclude scalajs dependencies using sbt-scalajs plugin ? I'm trying to import the following library "org.webjars.bower" % "react-bootstrap-datetimepicker" % "0.0.14" / "react-bootstrap-datetimepicker.js" But this library is downloading other…
user794783
  • 3,619
  • 7
  • 36
  • 58
3
votes
1 answer

How to use type-parameterized components with scalajs-react

I am using scalajs 0.6.15 with scalajs-react 0.11.3 and reactjs 15.4.2. Consider a component SomeComp where the type of a value of the Props needs to be parameterized. Since the type needs to be known when using the component builder I wrap the…
trudolf
  • 1,809
  • 16
  • 11
3
votes
1 answer

Referring to a non-existent class java.io.File

This question appears fundamentally the same as Linker error in ScalaJS: "Referring to non-existent class", but seems to differ in specifics. I don't specify a JVM version in build.sbt. I'm trying to access a file in my scalajs app using…
Tim Barrass
  • 4,813
  • 2
  • 29
  • 55
2
votes
1 answer

Scalajs-react: Uncaught TypeError: Cannot read properties of null (reading 'value')

I have following code for my scalajs-react application: def render(person: Person) = { <.div( <.p("Welcome!"), <.form( <.label("Name:", <.input(^.`type` := "text", ^.cls := "form-control", ^.value :=…
Mandroid
  • 6,200
  • 12
  • 64
  • 134
2
votes
1 answer

ScalaJs: How to define ScrollView with contentContainerStyle

In ScalaJs, I want to use justifyContent and alignItems style attribute but when I do it through normal style it says: ScrollView child layout (["alignItems", "justifyContent"]) must be applied through the contentContainerStyle prop. def render() =…
Taimur
  • 39
  • 6
2
votes
1 answer

Unable to run scalajs-react project

I'm just trying to set up scalajs-react using official docs, but faced an issue when I tried to run this sbt run: [info] Fast optimizing C:\temp\scalajs-react\target\scala-2.12\scala-js-tutorial-fastopt.js [info] Running…
Alex Karasev
  • 1,108
  • 2
  • 13
  • 24
2
votes
0 answers

stateless react components in scalajs-react

What is the easiest way to write this ({value}) =>
  • {value}
  • stateless react component in scalajs-react ? I've found the following related links on the net but they do not answer the…
    jhegedus
    • 20,244
    • 16
    • 99
    • 167
    2
    votes
    1 answer

    In scalajs with scalajs-react how do I pass a scalajs defined component to a javascript defined component?

    My issue is also here: https://gist.github.com/somanythings/8c3d34de754af311d7826ea837d160b4 In using scalajs with japgolly's scalajs-react (https://github.com/japgolly/scalajs-react) library. I am trying to wrap the griddle grid…
    lbp
    • 113
    • 1
    • 7
    2
    votes
    2 answers

    What is the difference between build, buildU & buildSpec in Scalajs-react?

    Can someone please explain the difference between the functions build, buildU and buildSpec for React components in scalajs-react and when to use one over the other ?
    user794783
    • 3,619
    • 7
    • 36
    • 58
    2
    votes
    2 answers

    Unable to import upickle with Scalajs-react shared dependencies

    i have a small problem. I am trying to use upickle lib. i have included it in my sharedDependencies as "com.lihaoyi" %%% "upickle" % "0.3.6". For some reason i am able to import upickle in my server project but it is still not available in my client…
    user4833870
    2
    votes
    1 answer

    How to troubleshoot JS dependencies between webjars and scala-js jars in an SBT project?

    I've been using scalajs-dom v 0.8.1 and trying to mix webjars within my SBT project. When I do this, I'm getting one final ambiguous JS reference that I can't figure out. I think it is between the webjars I want to use (that include jquery v…
    bjenkins001
    • 141
    • 1
    • 9
    1
    vote
    1 answer

    scalajs-react : Unexpected difference in Ajax GET vs DELETE

    I have following Ajax code for GET and DELETE use-cases in scalajs-react. DELETE: val ajax = Ajax("DELETE", "http://localhost:8081/delete/"+id) .setRequestContentTypeJsonUtf8 .send("") .onComplete { xhr => xhr.status match…
    Mandroid
    • 6,200
    • 12
    • 64
    • 134
    1
    2 3 4 5 6