Skip to content

Commit

Permalink
fix: React warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Atry committed Feb 1, 2023
1 parent 144716d commit 70afb97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,18 @@ object BindingHtmlToReact extends ComponentWrapper {
}
}

def current_=(wrapperElement: Element): Unit = {
def setter: js.Function1[Element, Unit] = { wrapperElement =>
wrapperVar.value = Some(wrapperElement)
}

def initialState = ()

def render() =
props.wrapper(this.asInstanceOf[ReactRef[Node with ParentNode]])
override def componentWillMount(): Unit = {
props.wrapper(setter.asInstanceOf[ReactRef[Node with ParentNode]])

override def componentDidMount(): Unit = {
super.componentDidMount()
mountPoint.watch()
super.componentWillMount()
}

override def componentWillUnmount(): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ object BindingReactToReact extends ComponentWrapper {

def render(): ReactElement = state

override def componentWillMount(): Unit = {
override def componentDidMount(): Unit = {
super.componentDidMount()
setterBinding.watch()
super.componentWillMount()
}

override def componentWillUnmount(): Unit = {
Expand Down

0 comments on commit 70afb97

Please sign in to comment.