Skip to content

cache Styles #10

Description

@ssomnoremac

so as it turns out styles should be cached for performance. Stylesheet uses a method called ReactNativePropRegistry.register(obj[key]); which effectively takes a style sheet like

let sheet = Stylesheet.create({
    red: {
        color: 'red'
    },
    blue: {
        color: 'blue'
    }
})

and creates an object with cached references (simple numbers)

sheet = {
    red: 17,
    blue: 18
}

So because this library uses inline styles we should be using number references for styles as well instead of actual styles. Should be fun and pretty easy to implement.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions