Dynamic selector for React components. Great for creating dynamic pages. Through some form of interaction, for example Loop, a page can be created dynamically. It can be used for a dynamic editor or even through a Json file.
Just install the dependency and start using
npm i requite or yarn add requite
After installing the dependency, just import the components you need
import Requite from "requite";
import Requite from "requite";
const Text = () => <p>Hello Text Component</p>;
const Header = () => <h1>Hello Header Component</h1>;
const ErrorHandler = () => <div>Component Type not found on Selector</div>; //this is not required
class Example extends Component {
render() {
const Components = {
1: Text,
Header: Header
};
return <Requite list={Components} type={"Header"} error={ErrorHandler} />;
}
}
MIT © vacom