Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript React Basics (retired) Thinking in Components Properties

hi i try to code in local host

i try to code in local host. my code seem working, all component appear the same as the video, but my button not showing any color (only black and white, not red and green like the video) ---------------------file : index.js-----------------------------------

const React = require('react'); const ReactDOM = require('react-dom'); var createReactClass = require('create-react-class');

let Application = createReactClass({
        render:function (){
            return(
                <div className="scoreboard">
                    <div className="header">
                        <h1>Scoreboard</h1>
                    </div>

                    <div className="players">
                        <div className="player">
                            <div className="player-name">
                                JIm hoder
                            </div>
                            <div className="player-score">
                                <div className="counter">
                                    <button className="counnter-action decrement"> - </button>
                                    <div className="counter-score">31 </div>
                                    <button className="counnter-action increment"> + </button>
                                </div>
                            </div>
                        </div>

                        <div className="player">
                            <div className="player-name">
                                JIm hoder
                            </div>
                            <div className="player-score">
                                <div className="counter">
                                    <button className="counnter-action decrement"> - </button>
                                    <div className="counter-score">31 </div>
                                    <button className="counnter-action increment"> + </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>   
            );
        }

});

ReactDOM.render(<Application />, document.getElementById('container'));

-----------------------------------// end file index.js----------------------------------

file : index.html

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>My app</title> <link rel="stylesheet" href="app/app.css"> </head> <body> <div id="container"></div> <script src="/app/bundle.js"></script> </body> </html>

-----------------------------------// end file index.html------------------------

2 Answers

You are misspelling their clases... You put counnter-action, it should be counter-action...

Gustavo Winter
PLUS
Gustavo Winter
Courses Plus Student 27,382 Points

Hi, could you post the css file.

CSS has a hard cascading style sheets, some times the cascading is overloading.

Check if the className is exactly the same and if there are any other class who canoverload.