japgolly on master
Update docs for changes in 1.4.0 (compare)
japgolly on v1.4.0
japgolly on master
Towards v1.4.1 (compare)
japgolly on master
Prepare for v1.4.0 Upgrade React to 16.6.3 React.lazy and 85 more (compare)
japgolly on v1.4.x
Add note about Reusability/Reus… doc formatting Prepare to release v1.4.0 (compare)
japgolly on v1.4.x
Test AsyncCallback.init Update Travis CI caching (compare)
japgolly on v1.4.x
Update Travis CI cache dirs Revise changelog (compare)
scalajs-react
?
So it seems some of the documentation has become stale in the post-Scala.JS-1.0-world, @arminio it'd be really appreciated if you would kindly submit a PR, or even an issue with a list of changes you had to make, so that we can update the doc for future users.
@japgolly PR for a small update to the test-state
documentation raised:
japgolly/test-state#144
CallbackKleisli
and then call .toJsFn
. (1) is nice and simple and (2) is a great option if you're doing lots of composition but in many cases it's likely to just be over-engineering for no benefit so you'll have to access your situation and choose whichever's best. Hope that helps
Hi @japgolly, I'm currently using scalablytyped definitions with react-window
. Their constructor for the FixedSizeList
component was translated as following:
object FixedSizeList {
// ...
def apply(
children: ComponentType[ListChildComponentProps],
height: Double | String,
itemCount: Double,
itemSize: Double,
width: Double | String
) { ...}
// ...
}
where ComponentType
is:
type ComponentType[P] = (japgolly.scalajs.react.raw.React.ComponentClassP[P with js.Object]) | typings.react.mod.FunctionComponent[P]
I've been trying to pass in a simple component and no matter what I try I can't get it to compile.
The closest I've got was this:
val comp = ScalaComponent.builder[ListChildComponentProps]("a").render_P { x => <.div("foo") }
Window.FixedSizeList(height = 800, width = 800, itemSize = 200, itemCount = 42,
children = ViaReactComponent(comp))
But then it returns boxed props and states so a mismatch again.
Any pointers on how I could get this to work?
ComponentType
is not the perfect type here, I haven't given this pattern much thought. Tell me if you find something better. The important thing is that what's taken as children
here is the javascript version of a component, I'm fairly sure there is a way to go from a scala component to a js component
Test.withRetryPolicy(policy)
Is there another option?
stEnableLongApplyMethod
mechanism wasn't implemented for react flavours. I added it here ScalablyTyped/Converter@a28e107 (along with a note that it's deprecated)