wp-pwa / saturn-app-theme-worona

Saturn theme for worona apps
1 stars 0 forks source link

Find a solution to use React in HTML content #20

Closed luisherranz closed 7 years ago

luisherranz commented 7 years ago

For example: https://github.com/andrejewski/himalaya

luisherranz commented 7 years ago

Or we can use this library: https://github.com/aknuds1/html-to-react

luisherranz commented 7 years ago

The desired component should look like something like this:

const Paragraph = ({ children, ...rest }) => <p ...rest>{children}</p>;
const Image = ({ children, ...rest }) => <img ...rest>{children}</p>;

<HtmltoReact html={html} p={Paragraph} img={Image} />

And should use normal Html tags if a component is not assigned.

luisherranz commented 7 years ago

👏👏👏

Poliuk commented 7 years ago

It looks like it is not working properly with the content from https://www.adslzone.tv/