Stack: Nextjs
Simple data binding not working until hot module reload.
I am using a data binding to a text field. This data is populated with fetch and text. Initially, the value is being rendered out as ‘undefined’ until I reload the page (via editing and saving).
The request is going through successfully every time without fail
NOTE: state.guid is defined
if (Builder.isBrowser) {
const res = await fetch(`doesn't matter/${state.guid}`);
const name = await res.text();
state.name = name;
// Place code that you only want to run in the browser (client side only) here
// For example, anything that uses document/window access or DOM manipulation
}
I can confirm that the context is not populated on the initial render, even though there is a response.