Skip to content
New issue

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

Model Code Does Not Work #4

Closed
kjgenevieve opened this issue Oct 7, 2019 · 1 comment
Closed

Model Code Does Not Work #4

kjgenevieve opened this issue Oct 7, 2019 · 1 comment

Comments

@kjgenevieve
Copy link

kjgenevieve commented Oct 7, 2019

Using the model code, I could not get the ColorBox to render.

Given code:

    render() {
        const newValue = this.props.value * 2;
 
        if (this.props.value < 100) {
            return (
                <div>
                    <Example value={newValue} />
                </div>
            );
        } else {
            return null;
        }
    }
}```

My ColorBox code:
```import React, { Component } from 'react';

export default class ColorBox extends Component {
  
  render() {    
    const newValue = this.props.opacity - 0.1;

    if (this.props.opacity >= 0.2) {
      return (
        <div>
          <ColorBox opacity={newValue} />
        </div>
      );
    } else {
      return null;
    }
  }
}```

Additionally, the solution code uses a different approach.
@maxwellbenton
Copy link
Contributor

Hi @kjgenevieve,

Thank you for opening this issue. We've updated this lesson based on your feedback - we've changed the example code snippet to include the required import and export statements and updated the solution to ColorBox so that it is more aligned with the example, which should resolve this issue.

We apologize for any frustration this may have caused you, but we appreciate you taking the time to provide feedback!

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants