import * as React from 'react'; import { observer } from 'mobx-react'; interface LyricItemContainerProps { timeline: number; text: string; translation: string | object; index: number; } @observer export default class LyricItemContainer extends React.Component { constructor(props: LyricItemContainerProps) { super(props); } render() { const { text, translation, index } = this.props; return (
  • { text } {(() => { if (translation) { return ( { translation } ); } // inject translation if exists })()}
  • ); } }