import React , { memo } from 'react' ; export function withDisplayName ( name ) { return < P extends object > ( Component ) => { Component . displayName = name ; return memo ( Component ) ; } ; } export function forwardRef < T > ( name ) { return < P extends object > ( Component ) => { return withDisplayName ( name ) ( React . forwardRef ( Component ) ) ; } ; }