Custom React

Custom React

To bring a better understanding to the world of web development and one of the most used web frameworks/libraries, React, I created a custom version of it. It is really simple, with no JSX, meaning no extension of HTML into JS functions. I built the fiber and virtual DOM myself and implemented a fast and usable router.

Code

Below you can see a short code snippet

    //  SPA/PWA (hash/history) Router
    function router() {
        return (new Snell.Router({
            type: "hash",
            routes: {
            "/": () => home(),
            "/car": () => car(),
            "/hvac": () => hvac(),
            "/navigation": () => navigation(),
            "/phone": () => phone(),
            "/battery": () => battery(),
            "/sound": () => sound(),
            "/microphone": () => microphone(),
            "/settings": () => settings(),
            "/information":  () => information(),
            "/error":  () => error(),
        }
        }).listen().on("route", async event => {
            return Snell.render(event.detail.route(), document.getElementById("root"));
        }));
    }
 
    //  Application with SPA/PWA (hash/history) Router
    function application(){
        return (
            router()
        )
    }
 
    export default application;

Get in touch with me via


August 10, 2023
finished
React, web development, custom version, fiber, virtual DOM, router, JSX, SPA, PWA