File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ describe('Components', () => {
147147 expect ( testStrategy . mock . calls [ 0 ] [ 0 ] . key ) . toBe ( apiKey ) ;
148148 } ) ;
149149
150- test ( 'A span is rendered if image geneation failed' , done => {
150+ test ( 'A span is rendered if image generation failed' , done => {
151151 const testStrategy = jest . fn ( data => Promise . reject ( 'test' ) ) ;
152152
153153 const wrapper = mount (
Original file line number Diff line number Diff line change @@ -126,7 +126,12 @@ class StaticGoogleMap extends Component {
126126 const childrenUrlParts = this . buildParts ( children , props ) || [ ] ;
127127 const mainUrlParts = MapStrategy ( props ) ;
128128
129- if ( Array . isArray ( childrenUrlParts ) ) {
129+ /**
130+ * All the parts should return a string if a component that does not return a promise isn't used
131+ * The Directions's component returns a promise and would instead use the Async component to render
132+ * This allows us render sync otherwise and partially support server side rendering.
133+ */
134+ if ( ! childrenUrlParts . some ( part => typeof part === 'object' ) ) {
130135 const childURL = childrenUrlParts . filter ( part => part ) . join ( '&' ) ;
131136 const url = `${ mainUrlParts } &${ childURL } ` ;
132137
You can’t perform that action at this time.
0 commit comments