-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fetch Nav fallbacks and side load resulting entity into state #50126
Conversation
|
||
const record = fallback?._embedded?.self; | ||
|
||
if ( record ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a debugger
here after the receiveEntityRecords
call and then switched to console
and ran:
wp.data.select('core').getEntityRecord('postType', 'wp_navigation', %%THE_ID%%)
...and the record is in state.
So why - with this non-Core data approach - do we get a 2nd network request coming from:
const navigationMenu = getEntityRecord( ...args ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider calling
dispatch.finishResolution( 'getEntityRecord', [
'postType',
'wp_navigation',
fallback?.id,
] );
Size Change: +102 B (0%) Total Size: 1.37 MB
ℹ️ View Unchanged
|
We went with #50032 |
What?
Alternative to #50032 resulting from suggestions by @draganescu
Why?
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast