Skip to content

Conversation

@jpinho
Copy link
Owner

@jpinho jpinho commented Sep 23, 2021

context

This PR is still pretty much work in progress, but I can already share what this intends to achieve!
One thing missing on ReactAdapter is that strange feeling that you can't write JSX. Example:

  <ReactAdapter el={Badge} badgeContent={4} color="primary" />

With ReactSlots, I will enable you to write this instead:

  <ReactSlot {badgeContent}>
    {`
      <Badge badgeContent={badgeContent} color="primary"></Badge>
    `}
  </ReactSlot>

The only gotcha is that any React component used within a ReactSlot will have to be declared on context variable called ReactComponentsLibrary. This limitation comes from the library that makes ReactSlot possible: JsxParser from 'react-jsx-parser'. But aside from this ReactSlot makes React code inside of Svelte look much better and natural.

⭐ ⭐ If you would like to have this implemented faster, please share and upvote the PR. ⭐ ⭐

@jpinho jpinho changed the title wip: feat: React Slots with JSX wip: feat: React Slots a way for more natural JSX within Svelte Sep 23, 2021
@jpinho jpinho added the wip label Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants