Before this PR the list or attributes was limited to explicitely listed src, filename, and options, while plugins was missing. Since this transformer only uses src and filename directly, we replace the remaining part rest spread and forward it to the upstream transformer. This solution also makes this implementation more future proof in case new parameters are added.
This PR fixes an issue where
plugins
parameter is not forwarded properly to the original transformer when svg-transformer is configured.See https://github.com/facebook/react-native/blob/main/packages/react-native-babel-transformer/src/index.js#L184 for the full list of attributes of the object that upstream transformer takes. And specifically note that except from
src
,filename
andoptions
, alsoplugins
is listed there.Before this PR the list or attributes was limited to explicitely listed
src
,filename
, andoptions
, whileplugins
was missing. Since this transformer only usessrc
andfilename
directly, we replace the remaining part rest spread and forward it to the upstream transformer. This solution also makes this implementation more future proof in case new parameters are added.