Open hein-j opened 1 year ago
Hey @hein-j, I was not able to reproduce the issue. To understand in the UI builder using the updateCat form, did you add a new field then hit update model to update the model in the data modelling page? When i did that I observed the following in the browser console.
additionally, also observed the following when switching from a data modelling page to content. refreshing the page fixed it. we should probably be more explicit for a need to refresh.
@ykethan - I can repro. Here are the steps:
The warning by itself is not a problem, but we rely on this component being properly controlled. Since it is not, you can see functionalities break, such as the Reset button not working.
Amplify.configure(awsconfig);
function App() {
const [cat, setCat] = useState()
async function load() {
const cats = await DataStore.query(Cat);
setCat(cats[0])
}
return (
<AmplifyProvider>
<button onClick={load}>Click</button>
<CatUpdateForm cat={cat}/>
</AmplifyProvider>
);
}
export default App;
Before opening, please confirm:
App Id
n/a
Region
n/a
Environment name
n/a
Figma File Version (if applicable)
No response
Amplify CLI Version
No response
If applicable, what version of Node.js are you using?
No response
What operating system are you using?
No response
Browser type?
No response
Describe the bug
If I have the following schema:
and save a Cat with no name (I can because it's an optional field) and then try to update the Cat with an auto-generated UpdateCatForm, I get the following warning in the console:
Expected behavior
The form should handle nullish values coming from Dynamo gracefully.
Reproduction steps
See description.
Project Identifier
No response
Additional information
No response