Skip to content

Commit

Permalink
Export all from page exports (#75)
Browse files Browse the repository at this point in the history
* Export all page methods

* Update package version
  • Loading branch information
aralroca authored Mar 12, 2020
1 parent 457f743 commit 4abec9d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions cli/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ export default function Page(p){
}
Page = Object.assign(Page, { ...C })
export * from '${prefix}/${clearPageExt(page)}'
`
}

Expand Down
9 changes: 8 additions & 1 deletion examples/static-site/pages_/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ import useTranslation from 'next-translate/useTranslation'
// @ts-ignore
import Header from '../components/header'

export default function Home() {
// @ts-ignore
export default function Home(props) {
const { t, lang } = useTranslation()
const description = t('home:description')
const linkName = t('home:more-examples')

console.log(props)

return (
<>
<Header />
Expand All @@ -21,3 +24,7 @@ export default function Home() {
</>
)
}

export const getStaticProps = async () => ({
props: { getStaticPropsWorks: true },
})
2 changes: 1 addition & 1 deletion examples/with-server/components/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Head from 'next/Head'
import Link from 'next/link'
import useTranslation from 'next-translate/useTranslation'

import styles from 'header.module.css'
import styles from './header.module.css'

export default function Header() {
const { t, lang } = useTranslation()
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next-translate",
"version": "0.10.5",
"version": "0.10.6",
"description": "Next.js utility to translate pages without the need of a server (static i18n pages generator).",
"license": "MIT",
"keywords": [
Expand Down

0 comments on commit 4abec9d

Please sign in to comment.