0

I want to do this:

const { colors as ThemeColors } = useTheme();

but I can't... and I don't want do this:

const { colors } = useTheme();
const ThemeColors = colors;

Do you know a way to do it ?

KAYZORK
  • 337
  • 1
  • 3
  • 17

1 Answers1

1

You can do something like this to create an alias (I don't know why it is called an alias, because for me alias is copied by reference):

const { colors: ThemeColors } = useTheme();

However, this is not copied by reference but as value. That means changing ThemeColors will not change colors.

FloWy
  • 934
  • 6
  • 14