Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upShadowed Wrapper-component doesn't receive doc prop #1476
Comments
|
That seems to be a mistake in the documentation or maybe that the components has changed since the writing of that part of the documentation. I think that the correct way is to shadow the import React from 'react'
import { Helmet } from 'react-helmet-async'
const SEO = (metadata) => {
return (
<Helmet
title={"My custom Title"}
titleTemplate={`%s | ${"My custom title"}`}
/>
)
}
export default SEO |
|
Basically I've created PR which allows setting SEO information without shadowing components. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
From the docs section Add favicon and metadata
Comment in code example states for "The
docprop contains some metadata about the page being rendered that you can use."But in the shadowed
Wrappercomponentdocis always undefined.To Reproduce
Create the Wrapper-component by shadowing the original Wrapper-component.
Check that
docprop isundefined.Expected behavior
Have access to
docprop to use its values for SEO related information or provide another way to alter SEO meta information.Environment
Additional context/Screenshots
From the codebase in the
Layoutcomponent, theWrappercomponent is used and doesn't receive any props.