Yomguithereal / react-blessed

A react renderer for blessed.
MIT License
4.45k stars 177 forks source link

Getting the 'image' tag to work #96

Closed mbodge closed 5 years ago

mbodge commented 5 years ago

Hi there, thanks for the library! I'm running into issues getting an Image element to work. I've added 'file-loader' plugin to my .babelrc and the file path is successfully loaded and prints out within a componentDidMount() here's my code:

import React, {Component} from 'react';
import logo from '../img/logo.png';

class App extends Component {
  render() {
    return (
      <box width={'100%'} height={'100%'} style={{ bg: 'white'}}>
        <image
          top={40}
          left={40}
          file={logo} />
      </box>
    );
  }
}

Any ideas?

mbodge commented 5 years ago

Ok I figured it out, and would just delete this but just in case anyone else is looking i replaced:

file={logo}

with:

file={__dirname + logo}