Add class to the extra div generated by withAuthenticator HOC
See original GitHub issueWhen wrapping withAuthenticator around a component, if the user is signed in, an extra div is created:
if (signedIn) {
return (
<div>
{
includeGreetings?
<Greetings
authState={authState}
authData={authData}
onStateChange={this.handleAuthStateChange}
/>
: null
}
<Comp
{...this.props}
authState={authState}
authData={authData}
onStateChange={this.handleAuthStateChange}
/>
</div>
)
}
There needs to be a way to either add properties to that div or to remove it.
Straight forward way would be to add another argument to the withAuthenticator function.
Workaround at this point is to simply use the Authenticator component directly.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Authenticator - React Native - AWS Amplify Docs
Using withAuthenticator HOC. For React Native, the simplest way to add authentication flows into your app is to use the withAuthenticator Higher Order ......
Read more >Add a class to the HTML <body> tag with React?
TL;DR use document.body.classList.add and document.body.classList.remove. I would have two functions that toggle a piece of state to ...
Read more >Amplify UI's new Authenticator component makes it easy to ...
Amplify UI's new Authenticator component makes it easy to add customizable login pages to your React, Angular, or Vue app.
Read more >Higher-Order Components In React - Smashing Magazine
A HOC is an advanced technique for reusing logic in React components. It is a pattern created out of React's compositional nature.
Read more >Add a class to the newly created div using JavaScript - YouTube
Working Demo:http://codifyacademy.com/youtube/wk09/video-04Download the source code ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jordanranz, yeah, fragment is preferable.
This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server
*-help
channels or Discussions for those types of questions.