You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many developers are more comfortable writing functions than classes. Create ReactClassBuilder that lets you create ReactClass purely by composing functions.
Draft (incomplete and highly likely to change, but just to demonstrate the idea):
case class ReactClassContext[WrappedProps, State](
native: js.Dynamic,
props: Props[WrappedProps],
state: State
) {
def setState(state: State): Unit = // ...
}
val reactClass: ReactClass =
ReactClassBuilder[Props, State]()
.shouldComponentUpdate((context: ReactClassContext[WrappedProps, State], nextContext: ReactClassContext[WrappedProps, State]) => Boolean)
.render((context: ReactClassContext[WrappedProps, State]) => ReactElement)
.build
The text was updated successfully, but these errors were encountered:
shogowada
changed the title
Create ReactClassSpecBuilder
Create ReactClassBuilder
Apr 15, 2017
Many developers are more comfortable writing functions than classes. Create
ReactClassBuilder
that lets you createReactClass
purely by composing functions.Draft (incomplete and highly likely to change, but just to demonstrate the idea):
The text was updated successfully, but these errors were encountered: