Implement review

- lint member order
- cleaner type coersion
- specify access modifiers everywhere
This commit is contained in:
Jorik Schellekens 2020-05-26 12:09:23 +01:00
parent dfc73626fa
commit ba3fe850e0
3 changed files with 18 additions and 23 deletions

View file

@ -46,12 +46,12 @@ export default class Tooltip extends React.Component<IProps> {
private parent: Element;
static defaultProps = {
public static readonly defaultProps = {
visible: true,
};
// Create a wrapper for the tooltip outside the parent and attach it to the body element
componentDidMount() {
public componentDidMount() {
this.tooltipContainer = document.createElement("div");
this.tooltipContainer.className = "mx_Tooltip_wrapper";
document.body.appendChild(this.tooltipContainer);
@ -62,12 +62,12 @@ export default class Tooltip extends React.Component<IProps> {
this.renderTooltip();
}
componentDidUpdate() {
public componentDidUpdate() {
this.renderTooltip();
}
// Remove the wrapper element, as the tooltip has finished using it
componentWillUnmount() {
public componentWillUnmount() {
dis.dispatch<ViewTooltipPayload>({
action: Action.ViewTooltip,
tooltip: null,
@ -128,7 +128,7 @@ export default class Tooltip extends React.Component<IProps> {
});
}
render() {
public render() {
// Render a placeholder
return (
<div className={this.props.className} >