Created
February 27, 2020 23:17
-
-
Save rmanalan/722aac404ad0c10286bfd5f3ad3d8690 to your computer and use it in GitHub Desktop.
Basic usage of gatsby-plugin-launchdarkly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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