1.0.4 • Published 4 years ago

gatsby-theme-react-native-web v1.0.4

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

gatsby-theme-react-native-web

This theme adds support for building Gatsby sites using React Native components.

Isn't there a plugin for this already?

Yes, there's one called gatsby-plugin-react-native-web.

This theme puts that plugin and its dependencies in a single package for increased lazyness developer experience:zap:.

Install

Run the following in your Gatsby site's directory.

yarn add gatsby-theme-react-native-web

Usage

Once installed, add the theme as a plugin in your gatsby-config.js.

// gatsby-config.js
module.exports = {
  plugins: [`gatsby-theme-react-native-web`],
}

That's it, you can now start building your Gatsby site using React Native components like in the example below.

Example

// src/pages/index.js
import React from "react"
import { StyleSheet, Text, View } from "react-native"

const styles = StyleSheet.create({
  box: { padding: 10 },
  text: { fontWeight: "bold" },
})

export default () => (
  <View style={styles.box}>
    <Text style={styles.text}>Hello, world!</Text>
  </View>
)