Crate htr

Crate htr 

Source
Expand description

HTML to react transformer

htr is a fast html to react transformer that uses btrees to search and replace html properties to the react equivalent.

§How to use htr

There are two ways to use htr:

  • Convert props React transform html string to a react string.
  • Convert to React Lets you transform the html to a react component.

§Basic usage

First, you will need to add htr to your Cargo.toml.

Next, add your html to one of the transform methods to get your react, output.

Re-exports§

pub use statics::HTML_PROPS;
pub use statics::SELF_ENCLOSED_TAGS;

Structs§

HTML_PROPS
html static list of properties that convert to camel-case [https://reactjs.org/docs/dom-elements.html]
SELF_ENCLOSED_TAGS
self enclosing tags - contains start < from builder

Functions§

convert_children_react
transform inline react children from script and style tags
convert_props_react
convert props to react
convert_to_react
convert props to a react component
create_style_object
manipulate and create the style properties to react
extract_html_props
extract all html props into a vector