Open
Description
Create styled-components
package wrapper that lets you use components without react-native-web
.
This may be necessary for styled-components/primitives
SSR support, or for use cases where react-native-web
isn't installed.
We should encourage the use of styled-components/primitives
instead, in documentation.
This could be a new package like @react-platform/styled
Pseudo-code for the wrapper:
const styled = Platform.select({
web: () => require('styled-components'),
default: () => require('styled-components/primitives'),
})();
if (Platform.OS === 'web') {
styled.View = styled.div;
styled.Text = styled.span;
styled.Image = styled.img;
} else {
styled.div = styled.View;
styled.img = styled.Image;
styled.span = styled.Text;
}
module.exports = styled;
Metadata
Metadata
Assignees
Labels
No labels