Skip to content

Commit

Permalink
Deprecate Container usage (vercel#8327)
Browse files Browse the repository at this point in the history
* Remove Container from examples

* Update readme to reflect Container removal
  • Loading branch information
timneutkens authored Aug 11, 2019
1 parent 6d25390 commit a90a555
Show file tree
Hide file tree
Showing 48 changed files with 186 additions and 283 deletions.
10 changes: 4 additions & 6 deletions examples/form-handler/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import App, { Container } from 'next/app'
import App from 'next/app'
import React from 'react'
import { Provider } from 'react-redux'
import withRedux from 'next-redux-wrapper'
Expand All @@ -18,11 +18,9 @@ class MyApp extends App {
render () {
const { Component, pageProps, store } = this.props
return (
<Container>
<Provider store={store}>
<Component {...pageProps} />
</Provider>
</Container>
<Provider store={store}>
<Component {...pageProps} />
</Provider>
)
}
}
Expand Down
6 changes: 3 additions & 3 deletions examples/with-antd-mobile/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react'
import App, { Container } from 'next/app'
import App from 'next/app'
import Head from 'next/head'

export default class CustomApp extends App {
render () {
const { Component, pageProps } = this.props
return (
<Container>
<>
<Head>
<meta
name='viewport'
Expand All @@ -22,7 +22,7 @@ export default class CustomApp extends App {
`}</style>
</Head>
<Component {...pageProps} />
</Container>
</>
)
}
}
10 changes: 4 additions & 6 deletions examples/with-apollo-and-redux-saga/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import App, { Container } from 'next/app'
import App from 'next/app'
import React from 'react'
import { Provider } from 'react-redux'
import withRedux from 'next-redux-wrapper'
Expand All @@ -20,11 +20,9 @@ class MyApp extends App {
render () {
const { Component, pageProps, store } = this.props
return (
<Container>
<Provider store={store}>
<Component {...pageProps} />
</Provider>
</Container>
<Provider store={store}>
<Component {...pageProps} />
</Provider>
)
}
}
Expand Down
10 changes: 4 additions & 6 deletions examples/with-apollo-and-redux/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import App, { Container } from 'next/app'
import App from 'next/app'
import React from 'react'
import { Provider } from 'react-redux'
import withRedux from 'next-redux-wrapper'
Expand All @@ -18,11 +18,9 @@ class MyApp extends App {
render () {
const { Component, pageProps, store } = this.props
return (
<Container>
<Provider store={store}>
<Component {...pageProps} />
</Provider>
</Container>
<Provider store={store}>
<Component {...pageProps} />
</Provider>
)
}
}
Expand Down
10 changes: 4 additions & 6 deletions examples/with-apollo-auth/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import App, { Container } from 'next/app'
import App from 'next/app'
import React from 'react'
import { ApolloProvider } from 'react-apollo'
import withApollo from '../lib/withApollo'
Expand All @@ -7,11 +7,9 @@ class MyApp extends App {
render () {
const { Component, pageProps, apolloClient } = this.props
return (
<Container>
<ApolloProvider client={apolloClient}>
<Component {...pageProps} />
</ApolloProvider>
</Container>
<ApolloProvider client={apolloClient}>
<Component {...pageProps} />
</ApolloProvider>
)
}
}
Expand Down
10 changes: 4 additions & 6 deletions examples/with-apollo/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import App, { Container } from 'next/app'
import App from 'next/app'
import React from 'react'
import withApolloClient from '../lib/with-apollo-client'
import { ApolloProvider } from 'react-apollo'
Expand All @@ -7,11 +7,9 @@ class MyApp extends App {
render () {
const { Component, pageProps, apolloClient } = this.props
return (
<Container>
<ApolloProvider client={apolloClient}>
<Component {...pageProps} />
</ApolloProvider>
</Container>
<ApolloProvider client={apolloClient}>
<Component {...pageProps} />
</ApolloProvider>
)
}
}
Expand Down
10 changes: 4 additions & 6 deletions examples/with-app-layout/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import App, { Container } from 'next/app'
import App from 'next/app'

class Layout extends React.Component {
render () {
Expand All @@ -12,11 +12,9 @@ export default class MyApp extends App {
render () {
const { Component, pageProps } = this.props
return (
<Container>
<Layout>
<Component {...pageProps} />
</Layout>
</Container>
<Layout>
<Component {...pageProps} />
</Layout>
)
}
}
12 changes: 5 additions & 7 deletions examples/with-context-api/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import App, { Container } from 'next/app'
import App from 'next/app'
/* First we import our provider */
import CounterProvider from '../components/CounterProvider'

class MyApp extends App {
render () {
const { Component, pageProps } = this.props
return (
<Container>
{/* Then we wrap our components with the provider */}
<CounterProvider>
<Component {...pageProps} />
</CounterProvider>
</Container>
/* Then we wrap our components with the provider */
<CounterProvider>
<Component {...pageProps} />
</CounterProvider>
)
}
}
Expand Down
10 changes: 4 additions & 6 deletions examples/with-fela/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import App, { Container } from 'next/app'
import App from 'next/app'
import React from 'react'
import FelaProvider from '../FelaProvider'

Expand All @@ -16,11 +16,9 @@ export default class MyApp extends App {
render () {
const { Component, pageProps, renderer } = this.props
return (
<Container>
<FelaProvider renderer={renderer}>
<Component {...pageProps} />
</FelaProvider>
</Container>
<FelaProvider renderer={renderer}>
<Component {...pageProps} />
</FelaProvider>
)
}
}
6 changes: 3 additions & 3 deletions examples/with-flow/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import App, { Container } from 'next/app'
import App from 'next/app'
import Link from 'next/link'
import React from 'react'

Expand All @@ -16,7 +16,7 @@ export default class MyApp extends App {
render () {
const { Component, pageProps } = this.props
return (
<Container>
<>
<header>
<nav>
<Link href='/'>
Expand All @@ -36,7 +36,7 @@ export default class MyApp extends App {
<Component {...pageProps} />

<footer>I`m here to stay</footer>
</Container>
</>
)
}
}
10 changes: 4 additions & 6 deletions examples/with-graphql-hooks/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import App, { Container } from 'next/app'
import App from 'next/app'
import React from 'react'
import withGraphQLClient from '../lib/with-graphql-client'
import { ClientContext } from 'graphql-hooks'
Expand All @@ -7,11 +7,9 @@ class MyApp extends App {
render () {
const { Component, pageProps, graphQLClient } = this.props
return (
<Container>
<ClientContext.Provider value={graphQLClient}>
<Component {...pageProps} />
</ClientContext.Provider>
</Container>
<ClientContext.Provider value={graphQLClient}>
<Component {...pageProps} />
</ClientContext.Provider>
)
}
}
Expand Down
10 changes: 4 additions & 6 deletions examples/with-graphql-react/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import 'cross-fetch/polyfill'
import { GraphQLProvider } from 'graphql-react'
import { withGraphQLApp } from 'next-graphql-react'
import App, { Container } from 'next/app'
import App from 'next/app'

class CustomApp extends App {
render () {
const { Component, pageProps, graphql } = this.props
return (
<Container>
<GraphQLProvider graphql={graphql}>
<Component {...pageProps} />
</GraphQLProvider>
</Container>
<GraphQLProvider graphql={graphql}>
<Component {...pageProps} />
</GraphQLProvider>
)
}
}
Expand Down
10 changes: 4 additions & 6 deletions examples/with-grommet/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import React from 'react'
import App, { Container } from 'next/app'
import App from 'next/app'
import { Grommet, grommet as grommetTheme } from 'grommet'

export default class MyApp extends App {
render () {
const { Component, pageProps } = this.props
return (
<Container>
<Grommet theme={grommetTheme}>
<Component {...pageProps} />
</Grommet>
</Container>
<Grommet theme={grommetTheme}>
<Component {...pageProps} />
</Grommet>
)
}
}
10 changes: 4 additions & 6 deletions examples/with-immutable-redux-wrapper/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import { Provider } from 'react-redux'
import App, { Container } from 'next/app'
import App from 'next/app'
import withRedux from 'next-redux-wrapper'
import { makeStore } from '../store'
import { fromJS } from 'immutable'
Expand All @@ -17,11 +17,9 @@ class MyApp extends App {
render () {
const { Component, pageProps, store } = this.props
return (
<Container>
<Provider store={store}>
<Component {...pageProps} />
</Provider>
</Container>
<Provider store={store}>
<Component {...pageProps} />
</Provider>
)
}
}
Expand Down
10 changes: 4 additions & 6 deletions examples/with-kea/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import { Provider } from 'react-redux'
import App, { Container } from 'next/app'
import App from 'next/app'
import withRedux from 'next-redux-wrapper'
import { initStore } from '../store'

Expand All @@ -16,11 +16,9 @@ export default class MyApp extends App {
render() {
const { Component, pageProps, store } = this.props
return (
<Container>
<Provider store={store}>
<Component {...pageProps} />
</Provider>
</Container>
<Provider store={store}>
<Component {...pageProps} />
</Provider>
)
}
}
6 changes: 3 additions & 3 deletions examples/with-loading/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import App, { Container } from 'next/app'
import App from 'next/app'
import Link from 'next/link'
import NProgress from 'nprogress'
import Router from 'next/router'
Expand Down Expand Up @@ -29,7 +29,7 @@ export default class MyApp extends App {
render () {
const { Component, pageProps } = this.props
return (
<Container>
<>
<div style={{ marginBottom: 20 }}>
<Link href='/'>
<a style={linkStyle}>Home</a>
Expand All @@ -46,7 +46,7 @@ export default class MyApp extends App {
</div>

<Component {...pageProps} />
</Container>
</>
)
}
}
10 changes: 4 additions & 6 deletions examples/with-mobx-react-lite/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import App, { Container } from 'next/app'
import App from 'next/app'
import React from 'react'
import { InjectStoreContext, initializeData } from '../store'

Expand All @@ -21,11 +21,9 @@ class MyMobxApp extends App {
render () {
const { Component, pageProps, initialStoreData } = this.props
return (
<Container>
<InjectStoreContext initialData={initialStoreData}>
<Component {...pageProps} />
</InjectStoreContext>
</Container>
<InjectStoreContext initialData={initialStoreData}>
<Component {...pageProps} />
</InjectStoreContext>
)
}
}
Expand Down
10 changes: 4 additions & 6 deletions examples/with-mobx-state-tree-typescript/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Provider } from 'mobx-react'
import { getSnapshot } from 'mobx-state-tree'
import App, { Container } from 'next/app'
import App from 'next/app'
import React from 'react'
import { initializeStore, IStore } from '../stores/store'

Expand Down Expand Up @@ -42,11 +42,9 @@ class MyApp extends App {
public render() {
const { Component, pageProps } = this.props
return (
<Container>
<Provider store={this.store}>
<Component {...pageProps} />
</Provider>
</Container>
<Provider store={this.store}>
<Component {...pageProps} />
</Provider>
)
}
}
Expand Down
Loading

0 comments on commit a90a555

Please sign in to comment.