{this.props.user.firstName ? `Hello ${this.props.user.firstName}!` : 'Hello there!'}
;
- }
-}
-
-export const GreetingClassHOC = withUser(GreetingClass);
-
-type GreetingProps = {
- greeting: string;
-};
-
-const GreetingFn = (props: WithUserProp) => {
- const { user, greeting } = props;
- return (
- <>
- {greeting}
- {user.firstName ? `Hello, ${user.firstName}!` : 'Hello there!'}
- >
- );
-};
-
-export const GreetingFnHOC = withUser(GreetingFn);
-
-class GreetingFaaC extends React.Component {
- render() {
- return {user => {user.firstName ? `Hello, ${user.firstName}!` : 'Hello there!'}
};
- }
-}
-
const UserExamplesPage: NextPage = () => {
return (
-
-
- {/**/}
);
};