Created
March 24, 2019 21:38
-
-
Save pburtchaell/290570543fa14888ca4576c85a1f9a11 to your computer and use it in GitHub Desktop.
This file contains 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
// 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