Fix broken type comparison for production app

This commit is contained in:
Melvin Valster
2019-07-26 18:38:41 +02:00
parent 2739717432
commit 8b03ff3c24
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -65,6 +65,7 @@ export class Talent extends React.PureComponent<Props> {
}
</div>
</Trigger>
<TalentTooltip talent={talent} points={points} errors={errors}>
{!disabled && points < talent.ranks.length && <p className="green tight">Click to learn</p>}
{points > 0 && <p className="green">Right-click to unlearn</p>}
+2 -2
View File
@@ -2,6 +2,7 @@ import React from 'react'
import ReactDOM from 'react-dom'
import { createPortal } from 'react-dom'
import { Map } from 'immutable'
import { Trigger } from './Trigger';
const TOOLTIP_ROOT = document.getElementById('tooltip-root')
@@ -76,8 +77,7 @@ export class Controller extends React.PureComponent<Props> {
const { isVisible, style } = this.state
return React.Children.map(children, (child: React.ReactElement) => {
const name = (child.type as any).name
if (name === 'Trigger') {
if (child.type === Trigger) {
return React.cloneElement(child, {
ref: this.trigger,
resize: this.updateTriggerRect,