Skip to content

marklawlor/react-native-optimizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-optimizer

React Native, like many other libraries, has various checks/mappings either for legacy or developer experience purposes. This project is a micro-optimizer that statically analyses the code and will remap props/components to their more optimal versions.

This library is a prototype, ideas and contributes are very welcome.

Available Optimizations

Text -> NativeText

<Text /> is a wrapper around <NativeText /> that remaps props and creates a <TextAncestor /> context to inherit styles for nested <Text />. If you are not using any of the props which are remapped and your <Text /> children are strings, you can use <NativeText /> directly.

Contributions wanted

<Text /> optimizations

View -> ViewNativeComponent

<View /> is a wrapper around <ViewNativeComponent /> that remaps props and resets the <TextAncestor /> context. If you are not using any of the props which are remapped, and the <View /> is not nested within a <Text />, you can use <ViewNativeComponent /> directly.

Static style flattening

React Native components internally flatten styles at runtime, but often we can statically flatten styles at build time.

Credits

This project is inspired by

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published