rsnext/examples/with-react-with-styles/pages/_app.js
Mohsen Azimi 9fb2432b14
Add ThemedStyleSheet.registerInterface to react-with-styles example (#13284)
My [draft PR was merged](https://github.com/zeit/next.js/pull/13193) so let's at least keep the code in canary in a working state.
2020-05-23 22:12:24 +00:00

26 lines
742 B
JavaScript

import React from 'react'
import { DIRECTIONS } from 'react-with-direction'
import AphroditeInterface from 'react-with-styles-interface-aphrodite'
import WithStylesContext from 'react-with-styles/lib/WithStylesContext'
import ThemedStyleSheet from 'react-with-styles/lib/ThemedStyleSheet'
import defaultTheme from '../defaultTheme'
function MyApp(props) {
const { Component, pageProps } = props
ThemedStyleSheet.registerInterface(AphroditeInterface)
return (
<WithStylesContext.Provider
value={{
stylesInterface: AphroditeInterface,
stylesTheme: defaultTheme,
direction: DIRECTIONS.LTR,
}}
>
<Component {...pageProps} />
</WithStylesContext.Provider>
)
}
export default MyApp