Flexible UI expression builder for React.
 
> Flexibile UI expression builder for React.
``bash`
npm install --save react-expression
`js
import React, { useState } from 'react';
import Expression from 'react-expression';
const presets = {
functions: {/ functions presets /},
datatypes: {/ datatypes presets /},
references: [/ references presets /],
operators: {/ operators presets /},
suggestions: {/ suggestions presets /},
};
function Example() {
const [operation, setOperation] = useState({
uuid: '',
args: [],
});
const [errors, setErrors] = useState([]);
const props = {
...presets,
operation
};
const onChange = (operation, errors) => {
setOperation(operation);
setErrors(errors);
}
return (
<>
Errors: {errors.join('; ')}
>
);
};
`
In the project directory, you can run:
`bash`
npm run start
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
`bash`
cd example && npm run start
Runs the example app in the development mode.
By default open http://localhost:3000 to view it in the browser.
`bash`
npm run build
Builds the app for production to the dist folder.
`bash`
npm run test
Launches the jest test runner in the interactive watch mode.
`bash`
npm run cypress:run
Runs Cypress tests to completion.
Before running, you need to run npm install and npm run build in the example (cd example).
`bash`
npm run cypress:open
Opens the Cypress Test Runner.
Before running, you need to run npm install and npm run build in the example (cd example`).
MIT License ©.
Author lempiy.
Collaborator grimm.