Closed mjashanks closed 6 years ago
Hey @mjashanks, thanks for reporting the issue.
The error you are seeing there is because you're using the glamorous dom component (glamorous.Div) rather than the glamorous dom component factory (glamorous.div).
const reactNode = (<glamorous.Div color="red">hello</glamorous.Div>)
const GlamorousComponent = glamorous.div({color: 'red'})
const reactNode = (<GlamorousComponent color="red">hello</GlamorousComponent>)
These are detailed further in the core concepts section of the glamorous documentation website https://glamorous.rocks/basics#core-concepts.
I've reworked your sandbox to use a dom component factory at the following link.
Thank you very much @luke-john - i feel silly :)
glamorous
version: 4.11.6glamor
version: 2.20.40react
version: 16.2.0Relevant code.
What you did: I am trying to use glamorous, using CJS modules & running from node.
I am currently needing to use CJS, as I am writing an application using Electronjs, and Javascript. In order to use native node modules (e.g. "fs", i need to use
require("fs")
)What happened:
An exception was thrown:
Reproduction:
https://codesandbox.io/s/pm2ww85nnj
I attempted to fork, and repro in a test, but could not
npm run validate
... have made a comment on that in #352