You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default visage should encourage developers to memoize styles prop so it'd be better to make styles prop immutable (uses ref to store the first reference to styles object and doesn't react to its changes). Also we can introduce a prop that says that the styles prop should be mutable ( default false ).
Also cache needs to be simplified, now the code is terrible. With babel plugin we can cache everything much easier because styles are hoisted (the ones that can be). With immutable styles prop it's little bit harder because we still need to serialize styles to know their hash quickly. Maybe we could leverage some cache id counter that can be used instead, so we don't need to check for equality of object.
The text was updated successfully, but these errors were encountered:
By default visage should encourage developers to memoize
styles
prop so it'd be better to makestyles
prop immutable (uses ref to store the first reference to styles object and doesn't react to its changes). Also we can introduce a prop that says that the styles prop should be mutable ( default false ).Also cache needs to be simplified, now the code is terrible. With babel plugin we can cache everything much easier because styles are hoisted (the ones that can be). With immutable styles prop it's little bit harder because we still need to serialize styles to know their hash quickly. Maybe we could leverage some cache id counter that can be used instead, so we don't need to check for equality of object.
The text was updated successfully, but these errors were encountered: