Skip to content

Commit

Permalink
expose theThemeContext to use the new context hook (segmentio#578)
Browse files Browse the repository at this point in the history
  • Loading branch information
2fd authored and Matt Shwery committed Jun 16, 2019
1 parent c1d94a9 commit fef0013
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export {
export { SidebarTab, Tab, Tablist, TabNavigation } from './tabs'
export { TagInput } from './tag-input'
export { TextInput, TextInputField } from './text-input'
export { ThemeProvider, ThemeConsumer, withTheme, defaultTheme } from './theme'
export { ThemeContext, ThemeProvider, ThemeConsumer, withTheme, defaultTheme } from './theme'
export { Textarea } from './textarea'
export { toaster } from './toaster'
export { Tooltip } from './tooltip'
Expand Down
2 changes: 1 addition & 1 deletion src/theme/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { default as defaultTheme } from './src/default-theme'
export { ThemeProvider, ThemeConsumer } from './src/ThemeContext'
export { default as ThemeContext, ThemeProvider, ThemeConsumer } from './src/ThemeContext'
export { default as withTheme } from './src/withTheme'
4 changes: 3 additions & 1 deletion src/theme/src/ThemeContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import defaultTheme from './default-theme'
/**
* Use React 16.3+ createContext API.
*/
const ThemeContext = React.createContext(defaultTheme)
const {
Provider: ThemeProvider,
Consumer: ThemeConsumer
} = React.createContext(defaultTheme)
} = ThemeContext

export default ThemeContext
export { ThemeProvider, ThemeConsumer }

0 comments on commit fef0013

Please sign in to comment.