Skip to content

Commit f2496a8

Browse files
Laurie BarthLaurie Barth
authored andcommitted
remove optional moduleExportName and align on default
1 parent 7572ca9 commit f2496a8

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

packages/gatsby-plugin-theme-ui/gatsby-node.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,19 @@ exports.createSchemaCustomization = ({ actions }) => {
2929
type ThemeUiConfig implements Node {
3030
themeModule: JSON,
3131
themeModulePath: JSON,
32-
moduleExportName: String,
3332
}
3433
`)
3534
}
3635

3736
exports.sourceNodes = (
3837
{ actions, createContentDigest },
39-
{ moduleExportName = 'default', themeModule, themeModulePath}
38+
{ themeModule, themeModulePath}
4039
) => {
4140
const { createNode } = actions
4241

4342
const themeUiConfig = {
4443
themeModule,
4544
themeModulePath,
46-
moduleExportName,
4745
}
4846

4947
createNode({

packages/gatsby-plugin-theme-ui/src/hooks/configOptions.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const useThemeUiConfig = () => {
66
themeUiConfig(id: { eq: "gatsby-plugin-theme-ui-config" }) {
77
themeModule
88
themeModulePath
9-
moduleExportName
109
}
1110
}
1211
`)

packages/gatsby-plugin-theme-ui/src/provider.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import useThemeUiConfig from './hooks/configOptions'
1111

1212
const Root = ({children}) => {
1313
const themeUiConfig = useThemeUiConfig()
14-
const {themeModule, themeModulePath, moduleExportName} = themeUiConfig
14+
const {themeModule, themeModulePath} = themeUiConfig
1515

1616
let themeWrapper
1717
if (themeModule) {
@@ -22,8 +22,8 @@ const Root = ({children}) => {
2222
themeWrapper = themeModulePath
2323
}
2424

25-
if(themeWrapper && (moduleExportName in themeWrapper)) {
26-
themeWrapper = themeWrapper[moduleExportName]
25+
if(themeWrapper && ('default' in themeWrapper)) {
26+
themeWrapper = themeWrapper.default
2727
}
2828

2929
themeWrapper = merge(themeWrapper, {

0 commit comments

Comments
 (0)