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:
TodorTotev 2020-05-19 12:16:24 +03:00 committed by GitHub
parent a6a8ee53ba
commit fd55ef9aaf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View file

@ -1,4 +1,3 @@
import React from 'react'
import App from 'next/app'
import { prepareClientPortals } from '@jesstelford/react-portal-universal'

View file

@ -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>
</>
)
}
}