Skip to content

Docs: conflict in next/script's onLoad documentation #33402

@akselinurmio

Description

@akselinurmio

What is the improvement or update you wish to see?

I'm afraid there's currently a conflict between the two documentation pages on next/script. The Script Component page says following:

If you are loading a script with either beforeInteractive or afterInteractive as a loading strategy, you can execute code after it has loaded using the onLoad property

However, in the API reference page on next/script, under onLoad, it says:

Note: onLoad can't be used with the beforeInteractive loading strategy.

As far as I know, the onLoad prop for beforeInteractive is not currently working and there's an open issue on that. Either way, the documentation should be in line with the current state of affairs.

Is there any context that might help us understand?

I can see the reason why a separate API documentation page for next/script exists in addition to the guide page on script optimization, but I would hope that any time either of those two are updated, the other would be checked for inconsistencies.

The inconsistency was created in #33097.

Does the docs page already exist? Please link to it.

No response

Metadata

Metadata

Labels

good first issueEasy to fix issues, good for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions