Remove redundant code from with-portals-ssr example (#13060)
* removed redundant imports and replaced the fragment with the shorthand syntax * Brought back the component import Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
This commit is contained in:
parent
a6a8ee53ba
commit
fd55ef9aaf
2 changed files with 4 additions and 5 deletions
|
@ -1,4 +1,3 @@
|
|||
import React from 'react'
|
||||
import App from 'next/app'
|
||||
import { prepareClientPortals } from '@jesstelford/react-portal-universal'
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as React from 'react'
|
||||
import { Component } from 'react'
|
||||
import { UniversalPortal } from '@jesstelford/react-portal-universal'
|
||||
|
||||
export default class Index extends React.Component {
|
||||
export default class Index extends Component {
|
||||
constructor() {
|
||||
super(...arguments)
|
||||
this.state = { opened: true }
|
||||
|
@ -17,7 +17,7 @@ export default class Index extends React.Component {
|
|||
|
||||
render() {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<>
|
||||
{/* A portal that is adjacent to its target */}
|
||||
<div id="target" />
|
||||
<UniversalPortal selector="#target">
|
||||
|
@ -65,7 +65,7 @@ export default class Index extends React.Component {
|
|||
</div>
|
||||
</UniversalPortal>
|
||||
)}
|
||||
</React.Fragment>
|
||||
</>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue