File tree Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 2
2
/* eslint-disable jsx-a11y/no-noninteractive-tabindex */
3
3
import React from 'react'
4
4
import classNames from 'classnames'
5
+ import omit from 'lodash/omit'
5
6
import { Field } from 'redux-form'
6
7
import PropTypes from 'prop-types'
7
8
import InputLabel from './parts/InputLabel'
@@ -85,7 +86,7 @@ CheckboxComponent.propTypes = {
85
86
isRequired : PropTypes . bool ,
86
87
small : PropTypes . bool ,
87
88
input : PropTypes . shape ( {
88
- value : PropTypes . oneOfType ( [ PropTypes . array , PropTypes . string ] ) ,
89
+ value : PropTypes . any ,
89
90
onChange : PropTypes . func ,
90
91
} ) ,
91
92
meta : PropTypes . shape ( {
Original file line number Diff line number Diff line change 6
6
"node" : " 12.x"
7
7
},
8
8
"scripts" : {
9
- "dev" : " next dev && npm run open " ,
9
+ "dev" : " next" ,
10
10
"rebuild" : " node importBuilder" ,
11
- "build" : " next build" ,
12
- "start" : " next start -p $PORT" ,
11
+ "build" : " next build && next export " ,
12
+ "start" : " next build && next start -p $PORT" ,
13
13
"open" : " concurrently \" http-server -a localhost -p 3000\" \" open http://localhost:3000\" " ,
14
14
"component" : " node tools/create/component.js" ,
15
15
"reboot" : " heroku builds:cancel -a forautoweb && heroku restart -a forautoweb" ,
File renamed without changes.
Original file line number Diff line number Diff line change @@ -49,11 +49,13 @@ const ListingPage: React.FunctionComponent<Props> = ({ prefetchedListing }) => {
49
49
const { t } = useTranslation ( )
50
50
const currentListing = useSelector ( currentListingSelector )
51
51
const loading = useSelector ( currentListingLoadingSelector )
52
+ console . log ( 'prefetchedListing' , prefetchedListing )
52
53
const router = useRouter ( )
53
54
const { id } = router . query
54
55
const listing : ListingType = isEmpty ( currentListing )
55
56
? prefetchedListing
56
57
: currentListing
58
+
57
59
useFindListing ( { id, prefetchedListing } )
58
60
useFindFeaturedListingsOnMount ( )
59
61
@@ -143,8 +145,8 @@ export async function getStaticPaths() {
143
145
export async function getStaticProps ( { params } : any ) {
144
146
try {
145
147
const listingsService = new ListingsService ( )
146
- const listing : ListingType [ ] = await listingsService . get ( params . id )
147
- return { props : { prefetchedListing : listing } , revalidate : 6000 }
148
+ const prefetchedListing : ListingType [ ] = await listingsService . get ( params . id )
149
+ return { props : { prefetchedListing } , revalidate : 6000 }
148
150
} catch ( e ) {
149
151
return { props : { prefetchedListing : null } , revalidate : 6000 }
150
152
}
You can’t perform that action at this time.
0 commit comments