Skip to content

Commit

Permalink
fix(docz): remove Children.only
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronauck committed Sep 28, 2018
1 parent 436fb86 commit 656d8f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
11 changes: 4 additions & 7 deletions packages/docz/src/components/Docs.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from 'react'
import { Children } from 'react'
import sort from 'array-sort'

import { state, Entry, EntryMap, Config } from '../state'
Expand Down Expand Up @@ -46,12 +45,10 @@ export const Docs: React.SFC<DocsProps> = ({ children }) => {
(a: Entry, b: Entry) => compare(a.name, b.name)
)

return Children.only(
children({
menus,
docs,
})
)
return children({
menus,
docs,
})
}}
</state.Consumer>
)
Expand Down
16 changes: 7 additions & 9 deletions packages/docz/src/components/ThemeConfig.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { ReactNode, SFC, Children } from 'react'
import { ReactNode, SFC } from 'react'
import merge from 'deepmerge'

import { themeContext } from '../theme'
Expand All @@ -23,14 +23,12 @@ export const ThemeConfig: SFC<ThemeConfigProps> = ({ children }) => {
{({ themeConfig, ...config }: Config) => {
const newThemeConfig = merge(initialThemeConfig, themeConfig)

return Children.only(
children({
...config,
themeConfig: transform
? transform(newThemeConfig)
: newThemeConfig,
})
)
return children({
...config,
themeConfig: transform
? transform(newThemeConfig)
: newThemeConfig,
})
}}
</state.Consumer>
)}
Expand Down

0 comments on commit 656d8f1

Please sign in to comment.