Closed reddigari closed 4 years ago
@reelmatt Good catch, and poor explanation on my part. The React useEffect
hook fires when the component gets its initial props, and triggers the callback with the initial values (whether defaults or loaded from disk). So the state in NodeConfig
should always be current.
Sets the stage for more complex configuration data needed for flow variables. The
NodeConfig
component has anupdateData()
method that builds the form data (takes arbitrary keys and values as parameters). The method is passed as a prop to every component rendering a form field, and whenever the form is changed, the callback is fired to update the state in theNodeConfig
component. When the form is saved, whatever data has been added via this method is sent as the payload to the server.