Skip to content
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

Add el helper #47

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