WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.49k stars 4.18k forks source link

DataForm: Consolidate `render` function argument #66616

Open gigitux opened 2 days ago

gigitux commented 2 days ago

Reviewing #66559, @oandregal noticed that the Edit function receives different arguments than the View function. We need to consolidate the arguments for both functions.

I just looked this up and it's confusing why the Edit function receives data (Item), field, onChange, hideLabelFromVision but the View function only receives the item (Item). There's also different names (data vs item) for the same prop across functions. I think we need to consolidate and:

The data prop should be called item in both places. The field should be passed down as a prop in both places.

@oandregal comment