Skip to content

Disable Props from Being Displayed in "data-page" attribute #1430

Closed Answered by reinink
abdorrahmani asked this question in Help (React)
Discussion options

You must be logged in to vote

Hey folks! So the data-page attribute is required on the initial Inertia page load — this is how we get the initial page data from the server to the client-side app (React, Vue, Svelte). This attribute is only necessary for the initial page visit, as all subsequent page visits are done via XHR and the page data is passed via JSON in those responses.

You can read about this in the docs on the protocol page:

The very first request to an Inertia app is just a regular, full-page browser request, with no special Inertia headers or data. For these requests, the server returns a full HTML document.

This HTML response includes the site assets (CSS, JavaScript) as well as a root <div> in the page…

Replies: 5 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@iambherulal
Comment options

@Twyar
Comment options

@iambherulal
Comment options

@Twyar
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by reinink
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants