glittershark/reactable

View on GitHub
src/reactable/th.jsx

Summary

Maintainability
A
0 mins
Test Coverage
import React from 'react';
import { isUnsafe } from './unsafe';
import { filterPropsFrom } from './lib/filter_props_from';

export class Th extends React.Component {
    render() {
        let childProps;

        if (isUnsafe(this.props.children)) {
            return <th {...filterPropsFrom(this.props)}
                dangerouslySetInnerHTML={{__html: this.props.children.toString()}}/>
        } else {
            return <th {...filterPropsFrom(this.props)}>
                {this.props.children}
            </th>;
        }
    }
};