Import css and component.
import RuleBuilder from 'rule-builder';
import 'rule-builder/dist/main.css';
<RuleBuilder state={[]}
actionProvider={actionProvider}
prepopulateEvents={true}
eventProvider={eventProvider}
attributeProvider={attributeProvider}
onChange={(state, isValid) => console.log(`Current state is: ${state}. isValid: ${isValid}`)} />
See [[RuleBuilderComponent]] for detailed documentation.
In the project directory, you can run:
Runs webpack in development mode, watches changes and bundles code
Builds the app for production to the dist
folder.
Generate documentation
In case you get following error 'hooks can only be called inside the body of a function component' You should add in Webpack following code to root level of config
resolve: {
alias: {
React: path.resolve('./node_modules/react'),
}
}