Skip to content

Instantly share code, notes, and snippets.

@rmanalan
Created February 27, 2020 23:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rmanalan/722aac404ad0c10286bfd5f3ad3d8690 to your computer and use it in GitHub Desktop.
Save rmanalan/722aac404ad0c10286bfd5f3ad3d8690 to your computer and use it in GitHub Desktop.
Basic usage of gatsby-plugin-launchdarkly
import React from "react"
import { Link } from "gatsby"
import Layout from "../components/layout"
import Image from "../components/image"
import SEO from "../components/seo"
import { useFlags } from 'gatsby-plugin-launchdarkly'
const IndexPage = () => {
const flags = useFlags()
return (
<Layout>
<SEO title="Home" />
<h1>{ flags.helloWorld ? 'Hello World!' : '' }</h1>
<p>Welcome to your new Gatsby site.</p>
<p>Now go build something great.</p>
<div style={{ maxWidth: `300px`, marginBottom: `1.45rem` }}>
<Image />
</div>
<Link to="/page-2/">Go to page 2</Link>
</Layout>
)
}
export default IndexPage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment