ignite
ignite copied to clipboard
How to automatically import images files in ignite 2.0?
Ignite 1 had a command ignite import imagesfile
and it would be nice to have an equivalent in Ignite 2.0.
Hey there @zbtang ! I assume you're using the https://github.com/infinitered/ignite-ir-boilerplate-2016 boilerplate. Just drop your image files into App/Images
, add it to App/Themes/Images.js
, and then use it like this:
import React from 'react'
import { View, Image } from 'react-native'
import { Images, Colors } from '../Themes'
import Styles from './Styles/MyImageStyles'
export default class MyImageComponent extends React.Component {
render () {
return (
{ /* other components... */ }
<Image style={Styles.yourImageStyle} source={Images.yourImageHere} />
{ /* other components... */ }
)
}
}
Hope this helps!
Hi, thanks ! But what I really mean is how to import images automatic . Because in Ignite 1.x there is a command ignite import imagesfile
to import all image files into Images.js file. Is there any command on version 2.0 to automatic import all image files?
Thanks !
Ah ... I'm not sure! Maybe @fvonhoven knows?
This is a good idea, but will need to wait for a future release.
@zbtang - this will return. Just need to rewrite it as a plugin.
Excited to hear that ! Thanks for your work !
this would be really appreciated
We'd appreciate help with this feature!