How to programmatically show exported json as the form #18
-
I am currently exploring this library. We need to allow users to save and edit existing forms for updates. I was trying to get the edit existing form json part and I wasn't sure if I was missing something.
I tried above code, and it never calls the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, @shishir-korde-tech9 const localBuilder = useRef<IFormBuilder>(null as any);
const [flag, setFlag] = useState(false);
useEffect(() => {
if (!flag) setFlag(true);
if (localBuilder.current) {
console.log(1)
}
}, [localBuilder, flag])
return <FormBuilder view={view} builderRef={localBuilder}/> |
Beta Was this translation helpful? Give feedback.
@sergeythrees - Thanks for taking time out to look into it. I have for now managed to get it done simply by using
getForm
function. I had tried it out earlier but have no idea why it didn't work. I did think of doing a flag to get around re-render but thats probably due to the refs wont trigger render when used as deps in react (which is on framework side rather than library itself). I am instead now setting my form data in state and using that to show pre configured forms, and that seems to be working normally.