Everything about Slinky -- issues, ideas for features, where it's being used, and more
@JSImport("resources/scss/card/style.scss", JSImport.Default)
@js.native
object Style extends js.Object
@react
object Card {
private val css = Style
case class Props(title: String, className: String, children: ReactElement)
val component = FunctionalComponent[Props] { props =>
Grid(className := s"{props.className} cardWrapper")(
Grid(className := "cardHeader")(
div(className := "cardHeaderLeft")(
h3(props.title)
)
), props.children
)
}
}
children
, it's special, and becomes a second parameter list
ProfileSearch.component(ProfileSearch.Props(props.search))
~/.ivy2/cache/me.shadaj/slinky-core-ijext_2.12/jars/slinky-core-ijext_2.12-0.6.5.jar
Uncaught java.lang.IllegalStateException: This component has already been built into a ReactElement, and cannot be reused
when I open and close my menu, which is weird, right?
shouldAggregate
, and another one that holds a key
based on which it loads a list of items from the server. Now, on a user click I want to change the key
as well as the shouldAggregate
, but the aggregation takes into effect immediately (this happens on the client) while loading the list takes time, so after the click I can see the current list aggregated before the new items arrive.DisplayPrefs { shouldAggregate0 =>
ItemFetcher(onComplete = gate.release()) { items =>
Gate(state = shouldAggregate0) { shouldAggregate =>
(if(shouldAggregate) aggregate(items) else items)
.map{ item => div(onClick = {fetcher.load(item))(item.name); dispPrefs.setAggregate(true)} }
}.withRef(gate)
}.withRef(fetcher)
}.withRef(dispPrefs)