Skip to content

About

Convert html template to react component

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

HTML to React

This is a node tool which can assist you to convert html template to react component.

Demo

https://youtu.be/PEeqDuRJs7s

Documentation

Step 1: Configure HTML file

The tool will detect the components throught the comment HTML tags.

 <!-- Wrapper -->
    <div id="wrapper" class="divided">
        <!-- SectionFirst -->
        <section>
            <h1>Frist Section</h1>
        </section>
         <!-- SectionSecond -->
        <section>
            <h1>Second Section</h1>
        </section>
    </div>

In this case, the tool assume that Wrapper Component contains Section1 Component and Section2 Component.

Step 2: Run code

Create a new file and then import index.js.

//sample.js

const createComponents = require('./index')
createComponents("./index.html", "Wrapper", "output")

The createComponents takes 3 parameter

Params Type Require Description
First string yes The path of HTML file
Second string yes Component's name
Third string yes The path of output folder

Execute code by node sample.

Feedback

If you have any feedback, please reach out to us at [email protected]

About

Convert html template to react component

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages