Skip to content

Commit

Permalink
refactor: make NextStudioLoading a named export
Browse files Browse the repository at this point in the history
BREAKING CHANGE: change `import NextStudioLoading from 'next-sanity/studio/loading'` to `import {NextStudioLoading} from 'next-sanity/studio/loading'`
  • Loading branch information
stipsan committed Jan 8, 2023
1 parent ad3ceb7 commit 086de6f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ Improve the Studio loading experience by setting a `loading.tsx` route.
'use client'

import config from '../../../sanity.config'
import NextStudioLoading from 'next-sanity/studio/loading'
import {NextStudioLoading} from 'next-sanity/studio/loading'

export default function Loading() {
return <NextStudioLoading config={config} />
Expand Down
2 changes: 1 addition & 1 deletion app/studio/[[...tool]]/loading.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import config from 'sanity.config'
import NextStudioLoading from 'src/studio/loading'
import {NextStudioLoading} from 'src/studio/loading'

export default function Loading() {
return <NextStudioLoading config={config} />
Expand Down
2 changes: 1 addition & 1 deletion src/studio/loading.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export {type NextStudioLoadingProps, NextStudioLoading as default} from './NextStudioLoading'
export {type NextStudioLoadingProps, NextStudioLoading} from './NextStudioLoading'
3 changes: 2 additions & 1 deletion test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ assert.equal(typeof NextStudioHead, 'function')

// Testing pkg.exports[./studio/loading]
const nextSanityStudioLoading = require('next-sanity/studio/loading')
assert.equal(typeof nextSanityStudioLoading, 'function')
const {NextStudioLoading} = nextSanityStudioLoading
assert.equal(typeof NextStudioLoading, 'function')

// Testing pkg.exports[./webhook]
const nextSanityWebhook = require('next-sanity/webhook')
Expand Down
2 changes: 1 addition & 1 deletion test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {NextStudioHead} from 'next-sanity/studio/head'
assert.equal(typeof NextStudioHead, 'function')

// Testing pkg.exports[./studio/loading]
import NextStudioLoading from 'next-sanity/studio/loading'
import {NextStudioLoading} from 'next-sanity/studio/loading'
assert.equal(typeof NextStudioLoading, 'function')

// Testing pkg.exports[./webhook]
Expand Down

0 comments on commit 086de6f

Please sign in to comment.