<commit_before>package me.shadaj.simple.react.core

import me.shadaj.simple.react.core.facade.{ComponentInstance, React}

import scala.language.implicitConversions
import scala.scalajs.js

class BuildingComponent[Props](private[BuildingComponent] val e: ExternalComponent, private[BuildingComponent] val props: Props) {
  def apply(children: ComponentInstance*)(implicit writer: Writer[Props]): ComponentInstance = {
    React.createElement(e.component, writer.write(props), children: _*)
  }
}

object BuildingComponent {
  implicit def shortCut[C <: ExternalComponent, Props](bc: BuildingComponent[Props])(implicit writer: Writer[Props]): ComponentInstance = {
    React.createElement(bc.e.component, writer.write(bc.props))
  }
}

trait ExternalComponent {
  type Props

  val component: js.Object

  def apply(p: Props): BuildingComponent[Props] = {
    new BuildingComponent(this, p)
  }
}<commit_msg>Change adding children to external component to have withChildren method instead of apply<commit_after>package me.shadaj.simple.react.core

import me.shadaj.simple.react.core.facade.{ComponentInstance, React}

import scala.language.implicitConversions
import scala.scalajs.js

class BuildingComponent[Props](private[BuildingComponent] val e: ExternalComponent, private[BuildingComponent] val props: Props, writer: Writer[Props]) {
  def withChildren(children: ComponentInstance*): ComponentInstance = {
    React.createElement(e.component, writer.write(props), children: _*)
  }
}

object BuildingComponent {
  implicit def shortcut[Props](bc: BuildingComponent[Props]): ComponentInstance = {
    bc.withChildren()
  }
}

trait ExternalComponent {
  type Props

  val component: js.Object

  def apply(p: Props)(implicit writer: Writer[Props]): BuildingComponent[Props] = {
    new BuildingComponent[Props](this, p, writer)
  }
}
{'fraction_non_alphanumeric': 0.10899182561307902, 'fraction_numerical': 0.0, 'mean_word_length': 6.00763358778626, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6204038', 'n_tokens_mistral': 539, 'n_tokens_neox': 526, 'n_words': 118}