react-native-view-shot
react-native-view-shot copied to clipboard
(Web) Add backgroundColor to captureRef
Html2canvas have backgroundColor option which is sets background color of captured image. Default value is "#FFFFFF" so if you capture image on web, there will be a white border on bottom. We need to add option to set html2canvas background. This pr does this.
I also set default value to null which is corresponds "transparent" on html2canvas side. This matches the native behavior better(iOS, Android).
Reproduce:
<View ref={viewRef} style={{ backgroundColor: "red", width: 50 }}>Test</View>
Before:
After
{ backgroundColor: "red" }:
Maybe we can get color from the ref view