1- import { Code , CodeBlock , H1 , H2 , Notice , P , TabbedCode } from '@/Components'
1+ import { A , Code , CodeBlock , H1 , H2 , Notice , P , TabbedCode } from '@/Components'
22import dedent from 'dedent-js'
33
44export const meta = {
@@ -9,6 +9,7 @@ export const meta = {
99 { url : '#title-callback' , name : 'Title callback' } ,
1010 { url : '#multiple-head-instances' , name : 'Multiple Head instances' } ,
1111 { url : '#head-extension' , name : 'Head extension' } ,
12+ { url : '#inertia-attribute-on-elements' , name : 'Inertia attribute' } ,
1213 ] ,
1314}
1415
@@ -371,6 +372,30 @@ export default function () {
371372 } ,
372373 ] }
373374 />
375+ < H2 > Inertia attribute on elements</ H2 >
376+ < P >
377+ Inertia has historically used the < Code > inertia</ Code > attribute to track and manage elements in the document{ ' ' }
378+ < Code > { '<head>' } </ Code > . However, you can now opt-in to using the more standards-compliant{ ' ' }
379+ < Code > data-inertia</ Code > attribute instead. According to the HTML specification, custom attributes should be
380+ prefixed with < Code > data-</ Code > to avoid conflicts with future HTML standards.
381+ </ P >
382+ < P >
383+ To enable this, configure the < Code > future.useDataInertiaHeadAttribute</ Code > option in your{ ' ' }
384+ < A href = "/client-side-setup#configuring-defaults" > application defaults</ A > .
385+ </ P >
386+ < CodeBlock
387+ language = "js"
388+ children = { dedent `
389+ createInertiaApp({
390+ // resolve, setup, etc.
391+ defaults: {
392+ future: {
393+ useDataInertiaHeadAttribute: true,
394+ },
395+ },
396+ })
397+ ` }
398+ />
374399 </ >
375400 )
376401}
0 commit comments