All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and adheres to Semantic Versioning.
- Fixed: clean up the project configuration for RN0.71, aligning some packages to the right version #271 by kelset & tido64
- Added: Add layout props to createText function #262 by robrechtme
- Fixed: Variant with breakpoints memoizing separate values into the same hash key by deconstructing breakpoint objects into strings #241 by mattfrances
- Added: Missing typography properties from React Native's Text Style Props #249 by mattfrances
- Fixed: New property error when using
react-native-reanimated
v3.0.0
by memoizing style values in a separateWeakMap
#237 by fortmarek
- Renamed gap shorthands to be lowercase #218 by mlecoq
- Better TypeScript type support #216 by FranzMoreno & fortmarek
- Upgrade React Native to 0.71 in #207 by mattfrances
- Add support of gap properties in #188 by mlecoq
- Handle Pressable function style prop by CodyBrouwers in #138
- Fix default variant not being applied by nelyousfi in #148
- Fix incorrect props when empty breakpoints. #115 by @nelyousfi
- Improve rendering performance on breakpoint changes and re-renders. #113 by @omulet
- Updated React Native to 0.66 and fixed eslint issues. #117 by @davebcn87
- Export ThemeContext for outside use. #80 by @mohsinulhaq
- Fixing the example usages of createRestyleComponent in the README. #82 by @lucasstorti
- Fix ts error for useRestyle hook. #87 by @andre-krueger
- Improve web support with StyleSheet when creating styles. #94 by @yuriazevedo11
- Fix removeEventListener warning in rn0.65. #112 by @alexanderstrom
- Update outdated Polaris tokens link in README.md. #114 by @nelyousfi
- Add 2-dimensional breakpoints #70 by @Johan-duitot
- Silently ignore any errors caused by missing a variant definition in the theme (e.g. textVariants), to preserve backwards compatibility. #64 by @jonogreenz
- Disallow creating a variant with the existing base theme keys of
colors, spacing, breakpoints, zIndices, borderRadii
. #64 by @jonogreenz - Improve rendering performance by removing unnecessary uses of the spread operator. #63 by @JoelBesada
Add a more descriptive error when theme is missing a key for a used variant.#59 by @Charly6596 (Replaced by PR #64)
- Add support for defining default values for variants in the theme. #51 by @Johan-duitot
- Improve typesafety of createRestyleFunction for correct property values. #36 by @hammadj
- Add
start
andend
(e.g.paddingStart
) properties where applicable to better support RTL layouts. #38 by @salzhrani - Fix
useRestyle
types not accepting a function created bycreateVariants
. #41 by @JoelBesada - Make
createRestyleComponent
,createBox
andcreateText
correctly forward theref
prop to the underlying component. #42 by @JoelBesada
- Improve type safety and type inference of
createVariant
,createBox
,createText
,useRestyle
,createRestyleFunction
andcreateRestyleComponent
. #16 and #21 by @hammadj, #26 by @Johan-duitot - Add a
createTheme
helper function to enforce proper shape for user themes. #18 by @hammadj - Add shorthand names for spacing and backgroundColor props. #22 by @hammadj
- Fix a bug in
createVariant
where defaults were only applied when the variant prop was passed in. #28 by @hammadj - Add a hook
useResponsiveProp
to deconstruct responsive prop values. #27 by @hammadj
- Public release
- Fix bug where
0
or other falsy values aren't allowed in the theme.
- Accept
children
by default in components created withcreateBox
andcreateText
.
- Fix a bug where
children
would always be a required prop increateRestyleComponent
.
- Rename library to
@shopify/restyle
- [BREAKING] Rename
useStyleSystem
touseRestyle
- [BREAKING] Rename
createStyleSystemFunction
tocreateRestyleFunction
- [BREAKING] Rename
createStyleSystemComponent
tocreateRestyleComponent
- Accept override component prop types in
createText
andcreateBox
.
- Accept optional underlying component to use in
createText
andcreateBox
.
- Fix component created with
createText
not accepting React NativeText
properties.
- Removed component override prop, it's not really needed in practice and it makes managing the types much more complicated.
- Added optional type argument to
useTheme
to set the returned type, e.g.useTheme<Theme>()
- Added
shadow
style function tocreateBox
- Added
textShadow
style function tocreateText
- Map
shadowColor
andtextShadowColor
tocolors
theme key
- Added
defaults
parameter tocreateVariant
to set default values that should be applied before anything from the theme.
- Compile library without JSX
- Changed TypeScript compile target to
es5
(instead ofesnext
)
- Initial release