Share Styles Across Multiple Components (6/6)


#1

https://www.codecademy.com/courses/react-102/lessons/style/exercises/styles-multiple-components

In the 6th instruction; I’ve allways this same error:
Oops! The test returned an error. Maybe you have a syntax error, or a typo. See full error.

import React from 'react';
import ReactDOM from 'react-dom';
import { AttentionGrabber } from './AttentionGrabber';
import { styles } from './styles';

const divStyle = {
  background: styles.background,
  height: '100%'
};

export class Home extends React.Component {
  render() {
    return (
      <div style={divStyle}>
        <AttentionGrabber />
        <footer>THANK YOU FOR VISITING MY HOMEPAGE!</footer>
      </div>
    );
  }
}

ReactDOM.render(
	<Home />, 
	document.getElementById('app')
);

Thanks!


#2

Maybe instead of you using a comma-, in

you should use a semi-colon-;
like
background: styles.background;


#3

Not because ‘divStyle’ is an object!


#4

I had the same issue, I have no idea what’s wrong here


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.