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)
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)
component.cmapCtorProps[…](…).toJsComponent.raw
. However, the grid requires some extra “lifecycle” functions to be available on some of the components, such as getValue(): js.Any
, which the grid uses to get the new value after editing is completed. I was hoping that if I put the functions in the Backend of the component, they would be visible to the grid. But, no matter what I try, I get this helpful message in the console: “ag-Grid: Framework component is missing the method getValue()”. Is there a way to make extra functions in a component visible to the grid?
getValue()
, right alongside render()
.