Skip to content

Add el helper #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 20, 2022
Merged

Add el helper #47

merged 2 commits into from
Dec 20, 2022

Conversation

sigma-andex
Copy link
Member

Add a little el helper function which makes it super easy and compact to use ReactComponents and combine them with the (simplified) html tags:

-- Import the simplified elements
import React.Basic.DOM.Simplified.Generated as R
-- | 
...
-- | 
-- Import your react components, e.g. from NextUI
foreign import container :: forall props. ReactComponent { | props }
foreign import row :: forall props. ReactComponent { | props }
foreign import col :: forall props. ReactComponent { | props }
-- | 
...
-- | 
-- Build your jsx
el container {} $ 
  el row {} $ 
  el col {} $ 
  R.div {} "Some text"

@mjrussell
Copy link
Member

Looks good! Appreciate the doc comments

@mjrussell mjrussell merged commit a598a32 into purescript-react:main Dec 20, 2022
@sigma-andex sigma-andex deleted the add-el-helper branch December 20, 2022 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy