Skip to content

cache Styles #10

@ssomnoremac

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.

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