menu
announcement

Spectrum is now read-only. Learn more about the decision in our official announcement.

styled-system

Style props for rapid UI development

Channels
Team

which is better : themeGet(path,fallbackVal) vs props.theme.pName

January 14, 2020 at 3:34am

which is better : themeGet(path,fallbackVal) vs props.theme.pName

January 14, 2020 at 3:34am
Hello. I feel lost making the choice of the better way to get values from theme object.
Using themeGet(path,fallbackVal) is ok, but it needs to import a new method themeGet. Using props.theme.pName is ok too. And it doesn't need extra imports. props.theme.pName || fallbackVal also support to declare fallback value.
Any advice?

January 29, 2021 at 7:07pm
I am also curious to know this as well.