import React, { Component } from "react"; import "./Link.scss"; const STATUS = { HOVERED: "hovered", NORMAL: "normal" }; type LinkProps = { page?: string; }; type LinkState = { classLink: string; }; class Link extends Component { state = { classLink: STATUS.NORMAL }; _onMouseEnter = () => { this.setState({ classLink: STATUS.HOVERED }); }; _onMouseLeave = () => { this.setState({ classLink: STATUS.NORMAL }); }; render() { const { page } = this.props; const { classLink } = this.state; return ( {this.props.children} ); } } export default Link;