logicore-react-pages
v1.0.0-alpha.10
Published
ReactJS-based declarative forms library
Downloads
12
Readme
logicore-react-pages
PRG-like approach for React + Django AJAX apps
Used together with: Django counterpart
Usage
Perform installation and configuration of
logicore-django-react
andlogicore-django-react-pages
: https://github.com/Logicore-project/logicore-django-react-pages#usageInstall:
yarn add logicore-react-pages
- Create minimal starter
App.js
:
import React from "react";
import { App, mainComponents, wrapperComponents } from "logicore-react-pages";
const MainWrapper = ({ result, onChange }) => {
const Component = mainComponents[result?.template];
return (
<>
{Component && result && <Component {...{ ...result, onChange }} />}
</>
);
};
Object.assign(wrapperComponents, {
MainWrapper,
});
const HomeView = (props) => {
return <div>Hello, {props.name}</div>;
};
Object.assign(mainComponents, {
HomeView,
});
export default App;
License
MIT © andrewboltachev