Skip to content

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