give name to forwardRef components

This commit is contained in:
NikolaBorislavovHristov 2019-01-22 15:49:05 +02:00
parent 6b28634dd0
commit ee6f135bf6
5 changed files with 10 additions and 0 deletions

View file

@ -44,4 +44,6 @@ const ButtonWithForwardedRef = React.forwardRef((props, ref) => (
<Button {...props} forwardedRef={ref} />
));
ButtonWithForwardedRef.displayName = 'ButtonWithForwardedRef';
export default ButtonWithForwardedRef;

View file

@ -9,4 +9,6 @@ const Focusable = React.forwardRef(({ children, ...props }, ref) => {
);
});
Focusable.displayName = 'Focusable';
export default Focusable;

View file

@ -4,4 +4,6 @@ const Label = React.forwardRef(({ children, ...props }, ref) => {
return React.cloneElement(React.Children.only(children), { ...props, ref });
});
Label.displayName = 'Popup.Label';
export default Label;

View file

@ -6,4 +6,6 @@ const Menu = React.forwardRef(({ children }, ref) => (
</div>
));
Menu.displayName = 'Popup.Menu';
export default Menu;

View file

@ -15,6 +15,8 @@ const ControlBarButton = React.forwardRef(({ icon, active, disabled, onClick },
</div>
));
ControlBarButton.displayName = 'ControlBarButton';
class ControlBar extends Component {
constructor(props) {
super(props);