Skip to content

Releases: jpudysz/react-native-unistyles

Release 2.3.0

08 Feb 09:45

Choose a tag to compare

2.3.0 (2024-02-08)

In this release I've brought you support for react-native-windows!
You can now build truly cross-platform desktop apps with Unistyles.

Also, there is one more improvement regarding boolean variants. Previously, if you defined only a true or false variant, they were converted respectively into a true or false string. This could be problematic if your props are of the boolean type. The error would indicate that the variant is expecting either true as a boolean or string. In this version, if you use a single true or false boolean variant, TypeScript will convert it to a generic boolean. Types won't be narrowed down to single values anymore.

Features

  • add windows support
  • add autolonking for windows
  • narrow down boolean variants (543e696)

Release 2.3.0-beta.2

07 Feb 11:27

Choose a tag to compare

Release 2.3.0-beta.2 Pre-release
Pre-release

2.3.0-beta.2 (2024-02-07)

  • add missing windows files to lib output

Release 2.3.0-beta.1

07 Feb 11:04

Choose a tag to compare

Release 2.3.0-beta.1 Pre-release
Pre-release

2.3.0-beta.1 (2024-02-07)

Features

  • enable windows autolinking (13786dd)

Release 2.3.0-beta.0

05 Feb 18:35

Choose a tag to compare

Release 2.3.0-beta.0 Pre-release
Pre-release

2.3.0-beta.0 (2024-02-05)

Features

  • add boilerplate for windows (b418a08)
  • add event handlers for windows (3a5a7a9)
  • add windows bridge (2e9a04b)

Release 2.2.0

26 Jan 13:25

Choose a tag to compare

2.2.0 (2024-01-26)

Features

  • update theme at runtime (35197ca)

You can now update the theme at runtime. This is useful if you want to show the user interface with default colors and later alter theme based on user preferences.

UnistylesRuntime.updateTheme('light', theme => ({
     ...theme,
     // override theme here 😈
     // if currently selected theme has been updated, unistyles will re-render
}))

Docs: https://reactnativeunistyles.vercel.app/reference/theming/#update-theme-during-runtime

Release 2.1.1

23 Jan 17:22

Choose a tag to compare

2.1.1 (2024-01-23)

Bug Fixes

  • initial screen height for ios (f64e2a8)

Release 2.1.0

23 Jan 08:35

Choose a tag to compare

2.1.0 (2024-01-23)

Features

Example

You can now use boolean values to select the variants:

import { useStyles } from 'react-native-unistyles'

const Component = ({ isPrimary, isDisabled }) => {
    const { styles } = useStyles(stylesheet, {
        color: !isDisabled,
        borderColor: isPrimary
        // you can also use strings
        // color: "true" | "false"
    })

    return (
        <View style={styles.container} />
    )
}

const stylesheet = createStyleSheet(theme => ({
    container: {
        // otter styles
        variants: {
            color: {
                true: {
                    backgroundColor: theme.colors.primary
                },
                false: {
                    backgroundColor: theme.colors.disabled
                },
                // you can still specify a default variant
                default: {
                    backgroundColor: theme.colors.barbie
                }
                // or other variants
                special: {
                    backgroundColor: theme.colors.special
                }
            },
            borderColor: {
                true: {
                    borderColor: theme.colors.primary
                }
                // you can also skip "false" here
            }
        }
    }
})

If you specify a boolean variants like “true”, there is no requirement to specify a “false” variant (and vice versa). You can mix boolean variants with other variants as well.

Release 2.0.2

17 Jan 23:26

Choose a tag to compare

2.0.2 (2024-01-17)

Features

  • export UnistylesValues type (b76078b)
  • mention in migration guide pod install (a68b5b8)

Release 2.0.1

12 Jan 01:16

Choose a tag to compare

2.0.1 (2024-01-12)

Bug Fixes

  • dependency array for no theme (d3c5031)

Release 2.0.0

02 Jan 11:12

Choose a tag to compare

2.0.0 (2024-01-02)

Features