import React from 'react';
export interface Props {
/** The user's name */
name: string;
/** Should the name be rendered in bold */
priority?: boolean
}
export interface FauxactClassComponent<Props extends {}, State = {}> {
props: Props
state: State
setState: (prevState: State, props: Props) => Props
callback?: () => void
render(): FauxactClassComponent<any> | null
}
export const PrintName: React.FC<Props> = (props) => {
return (
<div>
<p style={{ fontWeight: props.priority ? "bold" : "normal" }}>{props.name}</p>
</div>
)
}
export const ShowUser: React.FC<Props> = (props) => {
return <PrintName name="Ned" />
}
let username = "Cersei"
export const ShowStoredUser: React.FC<Props> = (props) => {
return <PrintName name={username} priority />
}