Skip to content

Commit d3b8a09

Browse files
committed
HookDefn propsType not needed
1 parent 8197dd3 commit d3b8a09

File tree

1 file changed

+2
-6
lines changed
  • library/coreGeneric/src/main/scala-2/japgolly/scalajs/react/hooks

1 file changed

+2
-6
lines changed

library/coreGeneric/src/main/scala-2/japgolly/scalajs/react/hooks/HookMacros.scala

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class HookMacros(val c: Context) extends MacroUtils {
3535
private def ScalaFn : Tree = q"_root_.japgolly.scalajs.react.component.ScalaFn"
3636
private def withHooks = "withHooks"
3737

38-
case class HookDefn(propsType: Tree, steps: List[HookStep])
38+
case class HookDefn(steps: List[HookStep])
3939
case class HookStep(name: String, targs: List[Tree], args: List[List[Tree]])
4040

4141
def render[P, C <: Children, Ctx, CtxFn[_], Step <: SubsequentStep[Ctx, CtxFn]]
@@ -92,11 +92,7 @@ class HookMacros(val c: Context) extends MacroUtils {
9292
if (args.nonEmpty)
9393
Left(() => s"$withHooks called with args when none exepcted: ${args.map(_.map(showCode(_)))}")
9494
else
95-
targs match {
96-
case props :: Nil => Right(HookDefn(props, steps))
97-
case Nil => Left(() => s"$withHooks called without targs, unable to discern Props type.")
98-
case _ => Left(() => s"$withHooks called multiple targs: ${targs.map(showCode(_))}")
99-
}
95+
Right(HookDefn(steps))
10096
} else {
10197
val step = HookStep(name, targs, args)
10298
log(s"Found step '$name'", step)

0 commit comments

Comments
 (0)