react-vtl-editor
A react VTL editor
The documentation can be found in the docs folder and browsed online.
Storybook is also available online.
Usage
import React, { useState } from 'react';
import { VtlEditor } from 'react-vtl-editor';
const MyComponent = () => {
const [value, setValue] = useState('');
const [valid, setValid] = useState(true);
return (
<>
<VtlEditor handleValue={setValue} handleValid={setValid} />
<div>{`My expression text : ${value}`}</div>
<div>{`Is my expression valid : ${valid}`}</div>
</>
);
};
export default MyComponent;
How to improve the library locally
In order to avoid some errors with the React library and your React application (two versions of React loaded by browser), you should not use the npm link
command. You should prefer the npm pack
command. You should have a look to this blog post for more informations.
Todo
- work on UI customization of the component