TypeError: null is not an object (evaluating 'children.push') SvgUri

Viewed 659

The SvgUri module of the react-native-svg library, works fine as it renders the icons by uri, but after a few seconds uses it throws errors like:

"TypeError: null is not an object (evaluating 'children.push')" or also: "Cannot read property 'push' of null This error is located at: in SvgUri"

which is almost the same mistake.

What can be done to fix the error?

NOTE: SvgUri is being used in the items of a FlatList

1 Answers

I had the same error. Turns out I accidentally had a trailing space in the url string.

const resourceUrl = 'https://example.com/filename.svg ' // <- naughty space

<SvgUri
  uri={resourceUrl}
/>
Related