fixes image url

master
Atul R 5 years ago
parent b8756ab420
commit 4f946abfb3
  1. 4
      src/index.tsx
  2. 3
      webpack.config.js

@ -7,10 +7,12 @@ import {
Image,
useEventHandler
} from "@nodegui/react-nodegui";
import path from "path";
import React, { useState } from "react";
import { AspectRatioMode, QPushButtonEvents } from "@nodegui/nodegui";
import imageUrl from "../assets/sample.jpg";
const distImgUrl = path.resolve(__dirname, imageUrl);
const fixedSize = { width: 500, height: 500 };
const App = () => {
@ -27,7 +29,7 @@ const App = () => {
<Text id="result">{`Time in epoc: ${time.getTime()}`}</Text>
<Image
style={imageStyle}
src={imageUrl}
src={distImgUrl}
aspectRatioMode={AspectRatioMode.KeepAspectRatio}
/>
</View>

@ -8,6 +8,9 @@ module.exports = {
path: path.resolve(__dirname, "dist"),
filename: "index.js"
},
node: {
__dirname: false
},
module: {
rules: [
{

Loading…
Cancel
Save