Skip to content

Instantly share code, notes, and snippets.

Created Jan 21, 2022
What would you like to do?
package slinky.core
import slinky.core.facade.ReactElement
import scala.scalajs.js
object FnComponent {
@inline def apply[P](fn: P => ReactElement)(implicit name: FunctionalComponentName): FunctionalComponent[P] = {
val ret: js.Function1[js.Object, ReactElement] = (obj: js.Object) => {
if (scala.scalajs.LinkingInfo.developmentMode) {
ret.asInstanceOf[js.Dynamic].displayName =
new FunctionalComponent[P](ret)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment