We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have installed react-svg and I am trying to import an svg image. Here is my file:
react-svg
import React, {PropTypes} from 'react'; import styles from '../common/contentBoxStyles'; import ReactSVG from 'react-svg'; const WeatherReport = ({report}) => { return ( <div style={styles.body} className="row"> <div style={styles.weatherBoxContainer}> <div className="col-sm-2 col-md-offset-1" style={styles.weatherBoxContainer.weatherCard}> <div style={styles.weatherBoxContainer.weatherReport}> <ReactSVG path={'../common/svg/O1n.svg'} callback={(svg) => console.log(svg)} /> <div className="row" style={styles.weatherBoxContainer.temps}> <div className="col-sm-4"> <div>{Math.floor(report.main.temp_max)}°</div> <div>{Math.floor(report.main.temp_min)}°</div> </div> <div className="col-sm-8" style={styles.weatherBoxContainer.currentTemp}> {Math.floor(report.main.temp)}° </div> </div> </div> CA </div> <div className="col-sm-2" style={styles.weatherBoxContainer.weatherCard}> <div style={styles.weatherBoxContainer.weatherReport}> Report </div> UT </div> <div className="col-sm-2" style={styles.weatherBoxContainer.weatherCard}> <div style={styles.weatherBoxContainer.weatherReport}> Report </div> MN </div> <div className="col-sm-2" style={styles.weatherBoxContainer.weatherCard}> <div style={styles.weatherBoxContainer.weatherReport}> Report </div> DC </div> <div className="col-sm-2" style={styles.weatherBoxContainer.weatherCard}> <div style={styles.weatherBoxContainer.weatherReport}> Report </div> NY </div> </div> </div> ); }; WeatherReport.propTypes = { report: PropTypes.object }; export default WeatherReport;
Here is my file structure:
src |_ _components | |_ _dashboard | | |_ _WeatherReport.js | |_ _common | |_ _svg | |_ _O1n.svg
Console reads out: Unable to load SVG file: ../common/svg/O1n.svg undefined
Unable to load SVG file: ../common/svg/O1n.svg
undefined
I have installed through npm w/o issues: svg-injector react-svg
svg-injector
What am I missing here?
The text was updated successfully, but these errors were encountered:
@Nappstir see #7. Sounds like you need to be running a local webserver.
Sorry, something went wrong.
Closing due to inactivity.
No branches or pull requests
I have installed
react-svg
and I am trying to import an svg image. Here is my file:Here is my file structure:
Console reads out:
Unable to load SVG file: ../common/svg/O1n.svg
undefined
I have installed through npm w/o issues:
svg-injector
react-svg
What am I missing here?
The text was updated successfully, but these errors were encountered: