copied over code from react-builder