Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Clearly state features in Readme #44

@cphoover

Description

@cphoover

Not to be a dick (and I hope I don't come off that way.) but what is the purpose of this library?

How is it any different from just doing something like this:

untested example:

<!doctype html>
<html>
...
<body>
    <div data-component="NavigationComponent"></div>
    <div data-component="SlideshowComponent"></div>
    <div data-component="FooterComponent "></div>
</body>
</html>
// bootstrap.js
const componentMap = {
    NavigationComponent : React.lazy(() => import('./NavigationComponent'));
    SlideshowComponent : React.lazy(() => import('./SlideshowComponent'));
    FooterComponent : React.lazy(() => import('./SlideshowComponent'));
};

const loadComponent = (componentName) => 
    Array.from(document.querySelectorAll(`[data-component=${componentName}]`))
       .forEach((node) => ReactDOM.render(componentMap[componentName], node))


Object.keys(componentMap)
    .forEach(loadComponent );

Perhaps it would be helpful if there was a feature list, or list of things this library does that otherwise wouldn't be possible. Does it allow for compatibility where otherwise there would be conflicts? Does it allow for multiple instances of react? What problems do react-habitat seek to solve?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions