Fix broken type comparison for production app
This commit is contained in:
@@ -65,6 +65,7 @@ export class Talent extends React.PureComponent<Props> {
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
|
|
||||||
<TalentTooltip talent={talent} points={points} errors={errors}>
|
<TalentTooltip talent={talent} points={points} errors={errors}>
|
||||||
{!disabled && points < talent.ranks.length && <p className="green tight">Click to learn</p>}
|
{!disabled && points < talent.ranks.length && <p className="green tight">Click to learn</p>}
|
||||||
{points > 0 && <p className="green">Right-click to unlearn</p>}
|
{points > 0 && <p className="green">Right-click to unlearn</p>}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import React from 'react'
|
|||||||
import ReactDOM from 'react-dom'
|
import ReactDOM from 'react-dom'
|
||||||
import { createPortal } from 'react-dom'
|
import { createPortal } from 'react-dom'
|
||||||
import { Map } from 'immutable'
|
import { Map } from 'immutable'
|
||||||
|
import { Trigger } from './Trigger';
|
||||||
|
|
||||||
const TOOLTIP_ROOT = document.getElementById('tooltip-root')
|
const TOOLTIP_ROOT = document.getElementById('tooltip-root')
|
||||||
|
|
||||||
@@ -76,8 +77,7 @@ export class Controller extends React.PureComponent<Props> {
|
|||||||
const { isVisible, style } = this.state
|
const { isVisible, style } = this.state
|
||||||
|
|
||||||
return React.Children.map(children, (child: React.ReactElement) => {
|
return React.Children.map(children, (child: React.ReactElement) => {
|
||||||
const name = (child.type as any).name
|
if (child.type === Trigger) {
|
||||||
if (name === 'Trigger') {
|
|
||||||
return React.cloneElement(child, {
|
return React.cloneElement(child, {
|
||||||
ref: this.trigger,
|
ref: this.trigger,
|
||||||
resize: this.updateTriggerRect,
|
resize: this.updateTriggerRect,
|
||||||
|
|||||||
Reference in New Issue
Block a user