Skip to content

Instantly share code, notes, and snippets.

@pburtchaell
Created March 24, 2019 21:38
Show Gist options
  • Save pburtchaell/290570543fa14888ca4576c85a1f9a11 to your computer and use it in GitHub Desktop.
Save pburtchaell/290570543fa14888ca4576c85a1f9a11 to your computer and use it in GitHub Desktop.
// Gets all design components exported from the canvas
export default function useDesignComponents() {
let canvas = require('../canvas.tsx')
let components = []
for (const key in canvas) {
if (!key.endsWith('__')) {
components = [...components, {
key: key,
displayName: key.replace(/_/g, ' '),
}]
}
}
return components
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment