Following up a previous question, I discovered a few things. I'm using the following two references (to the same file).
var Image1 = require("../assets/author.png");
import Image2 from "../assets/author.png";
In the render() method I attempt create markup in two ways.
<img style={imgStyle} src={Image1} />
<img style={imgStyle} src={Image2} />
Contrary to my expectations, those render differently.
<img style="margin: 15px;" src="1e0cf4ef57ac9ab0521646ee9c657eae.png">
<img style="margin: 15px;">
I'm not sure what to make of it.
What is the guid that the filename has been transformed to? Can I control it? Should I tamper with it?
What happens to the src part from the markup? Can it simply disappear like that? What can I do about it?
I've added a file with TypeScript definition as shown below in order to make the software understand that it's a valid module type. Not entirely sure if it actually achieves that goal, though.
declare module "*.png" {
const value: any;
export default value;
}