gatsby-gitbook-starter icon indicating copy to clipboard operation
gatsby-gitbook-starter copied to clipboard

Potential Error in appendString in mdxComponents/index.js

Open btray77 opened this issue 4 years ago • 0 comments

const appendString = (children) => { if (Array.isArray(children)) { return children.reduce((acc, current) => { if (typeof current === 'string') { return acc.concat(current); } else if (typeof current === 'object') { return acc.concat(current.props.children); } else { return acc; } }, ''); } else { return children + ''; // <-- Fix } }; It doesn't necessarily return a string type all the time, so have to force string.

btray77 avatar Aug 09 '21 21:08 btray77