Skip to content
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

Can I pass ID to the component? #21

Closed
smartdreams opened this issue Apr 1, 2019 · 5 comments
Closed

Can I pass ID to the component? #21

smartdreams opened this issue Apr 1, 2019 · 5 comments

Comments

@smartdreams
Copy link

Hi,

How do I pass "id" to this component? I have a section to display background image but it also requires to pass the html property "id" since external CSS is using ID. I tried using/wrapping with HOC but "id" didn't show up.

`

 const hoc = (WrappedComponent)=>(props)=>{

     return (
        <WrappedComponent {...props} id={props.id}>
        </WrappedComponent>
     )
 }

const TestHoc = hoc(BackgroundImage)

const Banner = (props) => (<div>

<TestHoc Tag="section" id="banner"
                       className="major"
                       fluid={props.bgImage}
                       backgroundColor={`#040e18`}>
    <h1>Hello gatsby-background-image</h1>
</TestHoc>     .......

`

@timhagn
Copy link
Owner

timhagn commented Apr 1, 2019

Hi @smartdreams,

thanks for your input, probably unwittingly removed it after the last round
of refactoring and additions % ). Gonna dig into it tomorrow ,
cause today my wife and I have our 12th relationship anniversary,
so no coding for me today : ).

Read ya tomorrow,

Tim.

@smartdreams
Copy link
Author

Sure thing.

Happy anniversary!

@timhagn
Copy link
Owner

timhagn commented Apr 2, 2019

Hi @smartdreams!
Thanks to @davebra's already merged in PR, your issue should be solved,
we now have an id prop and current release is 0.2.8-beta : ).

And thanks for the nice anniversary wishes, was a great evening / night : )!

EDIT: Should everything work as you wanted it to, would you do the honors and close this issue, or shall I?

@timhagn
Copy link
Owner

timhagn commented Apr 3, 2019

Hi @smartdreams!

Did you already get the chance to test 0.2.8-beta so we might close this issue?

Thanks in advance,

Tim.

@smartdreams
Copy link
Author

It works. Thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants