Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 10:57
  • Jan 30 2019 22:22
    bitpirate starred japgolly/scalajs-react
  • Jan 30 2019 08:11

    japgolly on master

    Update docs for changes in 1.4.0 (compare)

  • Jan 29 2019 13:20
  • Jan 28 2019 08:08
    booleguo starred japgolly/scalajs-react
  • Jan 28 2019 04:09

    japgolly on v1.4.0

    (compare)

  • Jan 28 2019 04:05

    japgolly on master

    Towards v1.4.1 (compare)

  • Jan 28 2019 04:04

    japgolly on master

    Prepare for v1.4.0 Upgrade React to 16.6.3 React.lazy and 85 more (compare)

  • Jan 28 2019 04:04
    japgolly closed #521
  • Jan 28 2019 04:04
    japgolly opened #521
  • Jan 28 2019 04:03

    japgolly on v1.4.x

    Add note about Reusability/Reus… doc formatting Prepare to release v1.4.0 (compare)

  • Jan 28 2019 04:02
    wiitht starred japgolly/scalajs-react
  • Jan 28 2019 03:18

    japgolly on v1.4.x

    Test AsyncCallback.init Update Travis CI caching (compare)

  • Jan 28 2019 03:02

    japgolly on v1.4.x

    Update Travis CI cache dirs Revise changelog (compare)

  • Jan 28 2019 03:00
    japgolly labeled #520
  • Jan 28 2019 03:00
    japgolly labeled #519
  • Jan 27 2019 17:36
  • Jan 26 2019 06:49
    japgolly commented #520
  • Jan 26 2019 05:55
    japgolly commented #519
  • Jan 26 2019 02:35
    cquiroz opened #520
jhegedus42
@jhegedus42

@jhegedus42 for me it doesn't compile...

you mean the git code ?

this ?
well, now I am having strange errors like this :
arn] Module Warning (from ./node_modules/source-map-loader/index.js):
[warn] (Emitted value instead of an instance of Error) Cannot find source file '../../../../../../../../../../../ramnivas/open-source/scalajs-react-bridge/core/target/scala-2.12/src_managed/main/com/payalabs/scalajs/react/bridge/GeneratedImplicits.scala': Error: Can't resolve '../../../../../../../../../../../ramnivas/open-source/scalajs-react-bridge/core/target/scala-2.12/src_managed/main/com/payalabs/scalajs/react/bridge/GeneratedImplicits.scala' in '/Users/joco/dev/im/github_private/im2020/modules/js/target/scala-2.12/scalajs-bundler/main'
GeneratedImplicits
which comes from :
 IO.write(file, s"""
                    |package com.payalabs.scalajs.react.bridge
                    |
                    |import scala.scalajs.js
                    |import scala.scalajs.js.Any._
                    |import japgolly.scalajs.react.CallbackTo
                    |
                    |trait GeneratedImplicits {
                    |  $functions
                    |}
        """.stripMargin.trim
  )
jhegedus42
@jhegedus42
but that is about source maps
[warn] Module Warning (from ./node_modules/source-map-loader/index.js):
so no big deal
Scala 2.13 ^
it's quite a big lib upgrade
jhegedus42
@jhegedus42
wow
I don't know what I did
but things started to work now again!
mvillafuertem
@mvillafuertem
hi there, i am trying to write a simple facade but i am getting this error. TypeError: null is not an object (evaluating 'c.ctor__Ljapgolly_scalajs_react_CtorType') I've been looking at other examples of facade and I don't know what I can be doing wrong. Any hint? Thanks in advance.

I have test with this

// Test 1
@js.native
@JSImport("@react-navigation/stack", JSImport.Namespace)
object RawComponent extends js.Object {
  def createStackNavigator(props: js.Object): js.Any = js.native
}

private val component =
    JsFnComponent[js.Object, Children.Varargs](RawComponent)


// Test 2

@js.native
@JSImport("@react-navigation/stack", "createStackNavigator")
object RawComponent extends js.Function1[js.Any, js.Any] {
  def apply(i: js.Any): js.Any = js.native
}

private val component =
    JsFnComponent[js.Object, Children.Varargs](RawComponent)

the original component https://github.com/react-navigation/react-navigation/blob/master/packages/stack/src/navigators/createStackNavigator.tsx#L28

Øyvind Raddum Berg
@oyvindberg
@mvillafuertem IIRC that is a function which returns a component. You can call it normally, and then put the result into JsComponent
mvillafuertem
@mvillafuertem
@oyvindberg Thanks! now it looks like this

@js.native
@JSImport("@react-navigation/stack", JSImport.Namespace)
object RawComponent extends js.Object {
  def createStackNavigator(): StackNavigator = js.native
}

@js.native
trait StackNavigator extends js.Object {

  val Navigator: ComponentClassP[js.Object] = js.native
  val Screen:    ComponentClassP[js.Object] = js.native

}
private val Stack = RawComponent.createStackNavigator()

val Navigator = JsFnComponent[DefaultNavigatorOptions[StackNavigationOptions, ParamListBase], Children.Varargs](Stack.Navigator)
 val Screen    = JsFnComponent[js.Object, Children.Varargs](Stack.Screen)
Mayeul Marcadella
@Marcadella_gitlab

Hi, Scalajs-react won't apply width and size to an img for some reason.

<.img(
            ^.src := ...,
            ^.width := "50",
            ^.height := "50"
          )

But the DOM gets only <img src=...>. Any idea why?

johnhungerford
@johnhungerford
is there a way to express a general type for a react component of a given prop type, such that I can make it the parameter of another component that can then render it?
class MyComponent(someComponent : Component[SomePropsType, ?, ?, ... ] ) {
   ...
   val downstreamProps : SomePropsType
   ...
   lazy val component = ScalaComponent.builder[ Unit ]
          .render_P( pr => render(  someComponent(downstreamProps) ) )
          .build
}
in the Component[SomePropsType, ...] type, if I leave the other type parameters as _, the compiler won't allow me to pass props to the component
nafg
@nafg
Use type parameters
This is a general scala question btw, not specific to scalajs-react
johnhungerford
@johnhungerford
I know how to use type parameters -- the issue is that the CtorType parameter (P, S, B, CT[-p, +u] <: CtorType[p, u]) is so weird, I haven't been able to figure out how to express it generically so that I can call .apply(props) on any possible react component
nafg
@nafg
You need to specify the same constraints and structure in your type parameters
Try it and post back with specific code and compiler errors
(by structure I mean e.g. the kind, e.g. CT is higher-kinded)
johnhungerford
@johnhungerford
thanks will do
David Barri
@japgolly

@/all https://twitter.com/japgolly/status/1390125799949291522?s=20

Would anyone be interested in watching/joining me for a live stream of me adding support for React Hooks to #scalajs-#react?
DM me on Twitter, or email me at japgolly@gmail.com!
I guess I'm a bit sick of covid monotony, I guess I miss social interaction, something new like this might be fun.

David Barri
@japgolly
And btw, as usual, I won't be back to check replies here becos I'm swamped with work but anyone can reach me via Twitter, Email, or Github. I think that's plenty. Thanks all
And btw while I have your attention, thank you so so soooooooooooo much to all the legends who are always active on here and help people out when they ask for help. It's a beautiful thing that I personally don't need to be involved for the community to thrive. I love that the community has a life of its own and that I'm just a part of it. It's the way it should be so thank you all so much for being awesome.
Andreas Gabor
@an-tex
nice words :) really appreciate your work on this awsm library!
Vu Duc Nhi
@vdnhi

Hi @japgolly ,

I'm doing nested router with scalajs-react and wonder how can I get RouterCtl in the nested module? I mean I can use renderR in the nested module. My use case is I want to the nested page to have all information about the navigation to build the menu navigation across all nested modules.