Skip to content

Instantly share code, notes, and snippets.

@geraldodev
Last active July 5, 2023 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geraldodev/1bd53e88a1217c8e560843b53e93a53b to your computer and use it in GitHub Desktop.
Save geraldodev/1bd53e88a1217c8e560843b53e93a53b to your computer and use it in GitHub Desktop.
How would you map a default function component to clojurescript when generating equivalent code ?
{:type "File",
:errors [],
:program
{:type "Program",
:sourceType "module",
:interpreter nil,
:body
[{:type "ExportDefaultDeclaration",
:exportKind "value",
:declaration
{:async false,
:params [],
:type "FunctionDeclaration",
:id {:type "Identifier", :name "AccordionDemo"},
:generator false,
:isReactComponent true,
:body
{:type "BlockStatement",
:body
[{:type "ReturnStatement",
:argument
{:type "JSXElement",
:openingElement
{:type "JSXOpeningElement",
:name {:type "JSXIdentifier", :name "div"},
:attributes [],
:selfClosing false},
:closingElement
{:type "JSXClosingElement",
:name {:type "JSXIdentifier", :name "div"}},
:children
[{:type "JSXText",
:extra {:rawValue "test", :raw "test"},
:value "test"}]}}],
:directives []}}}],
:directives []},
:comments []}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment