gatsbypropshandler

1.1.0 • Public • Published

This is a simple way to fake props in gatsby. It allows you to add key:value pairs to a file that is able to be refrenced anywhere in your code. the format looks like this:

// now works with arrays! ... just put an array into the prop field and it will destructure and the the objects in the array for you.... if it is not an array of objects it will fail gracefully

// import the props from gatsbypropshandler
import { props } from 'gatsbypropshandler'

// add a prop in the form of an object .... and only an object, nothing else works at present.... it should fail gracefully though
props({ hello: 'world' })

// refrencing the prop anywhere is a similiar format... but pass in just the key value as a string props('hello') // returns 'world'

Readme

Keywords

none

Package Sidebar

Install

npm i gatsbypropshandler

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

2.64 kB

Total Files

3

Last publish

Collaborators

  • nicholasshankland