use typescript

This commit is contained in:
Bastian Ike
2020-07-16 11:07:42 +02:00
committed by Bastian
parent 442d964180
commit be0241674c
93 changed files with 9750 additions and 2190 deletions

View File

@@ -0,0 +1,40 @@
// import React from 'react';
// todo fix this mess
// const _callSetTitle = (props) => {
// if (typeof props.onSetTitle === 'function' && props.title) {
// props.onSetTitle(props.title);
// }
// };
// class _SetTitle extends React.Component {
// constructor(props) {
// super(props);
// _callSetTitle(props);
// }
// componentWillReceiveProps(nextProps) {
// if (nextProps.title !== this.props.title) {
// _callSetTitle(nextProps);
// }
// }
// render() {
// return null;
// }
// }
type SetTitleProps = {
title: string
onSetTitle?: (title: string) => void
}
export default function SetTitle({title, onSetTitle}: SetTitleProps) {
if (onSetTitle) {
onSetTitle(title)
}
return null;
}