TypeError: Cannot read property 'color' of undefinedCannot read property 'map' of undefinedReact - uncaught TypeError: Cannot read property 'setState' of undefinedUncaught TypeError: Cannot read property 'bind' of undefinedTypeError: Cannot read property 'prepareStyles' of undefinedTypeError: cannot read property setState of undefinedUncaught TypeError: Cannot read property 'func' of undefinedHow do I pull the props from a child to the parent?Cards in ReactjsChanging style property with setState in ReactRedux state value used as a style property value?

Why is Skinner so awkward in Hot Fuzz?

Realistic, logical way for men with medieval-era weaponry to compete with much larger and physically stronger foes

Any gotchas in buying second-hand sanitary ware?

Writing mathematical symbol with bold

Should I move out from my current apartment before the contract ends to save more money?

How can I find out about the game world without meta-influencing it?

Boss making me feel guilty for leaving the company at the end of my internship

What is the theme of analysis?

Do the Shadow Magic sorcerer's Strength of the Grave feature and the half-orc's Relentless Endurance trait work together?

Is it possible to install Firefox on Ubuntu with no desktop enviroment?

Can I get a photo of an Ancient Arrow?

Does an African-American baby born in Youngstown, Ohio have a higher infant mortality rate than a baby born in Iran?

Past vs. present tense when referring to a fictional character

Are athletes' college degrees discounted by employers and graduate school admissions?

Approach sick days in feedback meeting

What publication claimed that Michael Jackson died in a nuclear holocaust?

I received a gift from my sister who just got back from

How Many Times To Repeat An Event With Known Probability Before It Has Occurred A Number of Times

Is all-caps blackletter no longer taboo?

Can you open the door or die? v2

Am I being scammed by a sugar daddy?

Optimising matrix generation time

Dedicated bike GPS computer over smartphone

Should I email my professor to clear up a (possibly very irrelevant) awkward misunderstanding?



TypeError: Cannot read property 'color' of undefined


Cannot read property 'map' of undefinedReact - uncaught TypeError: Cannot read property 'setState' of undefinedUncaught TypeError: Cannot read property 'bind' of undefinedTypeError: Cannot read property 'prepareStyles' of undefinedTypeError: cannot read property setState of undefinedUncaught TypeError: Cannot read property 'func' of undefinedHow do I pull the props from a child to the parent?Cards in ReactjsChanging style property with setState in ReactRedux state value used as a style property value?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I am getting a Type Error that says Cannot read property 'color' of undefined



 renderMessage(message) 
const member, text = message;
const currentMember = this.props;
const messageFromMe = member.id === currentMember.id;
const className = messageFromMe ?
"Messages-message currentMember" : "Messages-message";
return (
<li className=className>
<span
className="avatar"
style=backgroundColor: member.clientData.color
/>
<div className="Message-content">
<div className="username">
member.clientData.username
</div>
<div className="text">text</div>
</div>
</li>
);

}


The code is compiling in node js but it outputs a error message in the browser










share|improve this question



















  • 1





    Have you done any debugging to see why clientData is undefined?

    – Sterling Archer
    Mar 25 at 1:57











  • i have done a bit i am allot sure that it is a syntax problem but i cant seem to see the member of client data

    – Charles Evans
    Mar 25 at 2:10











  • Follow the logs. If clientData is undefined, that means something is wrong with the member property, which means the message param passed in is not what you expect

    – Sterling Archer
    Mar 25 at 2:11

















1















I am getting a Type Error that says Cannot read property 'color' of undefined



 renderMessage(message) 
const member, text = message;
const currentMember = this.props;
const messageFromMe = member.id === currentMember.id;
const className = messageFromMe ?
"Messages-message currentMember" : "Messages-message";
return (
<li className=className>
<span
className="avatar"
style=backgroundColor: member.clientData.color
/>
<div className="Message-content">
<div className="username">
member.clientData.username
</div>
<div className="text">text</div>
</div>
</li>
);

}


The code is compiling in node js but it outputs a error message in the browser










share|improve this question



















  • 1





    Have you done any debugging to see why clientData is undefined?

    – Sterling Archer
    Mar 25 at 1:57











  • i have done a bit i am allot sure that it is a syntax problem but i cant seem to see the member of client data

    – Charles Evans
    Mar 25 at 2:10











  • Follow the logs. If clientData is undefined, that means something is wrong with the member property, which means the message param passed in is not what you expect

    – Sterling Archer
    Mar 25 at 2:11













1












1








1








I am getting a Type Error that says Cannot read property 'color' of undefined



 renderMessage(message) 
const member, text = message;
const currentMember = this.props;
const messageFromMe = member.id === currentMember.id;
const className = messageFromMe ?
"Messages-message currentMember" : "Messages-message";
return (
<li className=className>
<span
className="avatar"
style=backgroundColor: member.clientData.color
/>
<div className="Message-content">
<div className="username">
member.clientData.username
</div>
<div className="text">text</div>
</div>
</li>
);

}


The code is compiling in node js but it outputs a error message in the browser










share|improve this question
















I am getting a Type Error that says Cannot read property 'color' of undefined



 renderMessage(message) 
const member, text = message;
const currentMember = this.props;
const messageFromMe = member.id === currentMember.id;
const className = messageFromMe ?
"Messages-message currentMember" : "Messages-message";
return (
<li className=className>
<span
className="avatar"
style=backgroundColor: member.clientData.color
/>
<div className="Message-content">
<div className="username">
member.clientData.username
</div>
<div className="text">text</div>
</div>
</li>
);

}


The code is compiling in node js but it outputs a error message in the browser







reactjs






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 25 at 1:57









Sterling Archer

16.3k136391




16.3k136391










asked Mar 25 at 1:53









Charles EvansCharles Evans

61




61







  • 1





    Have you done any debugging to see why clientData is undefined?

    – Sterling Archer
    Mar 25 at 1:57











  • i have done a bit i am allot sure that it is a syntax problem but i cant seem to see the member of client data

    – Charles Evans
    Mar 25 at 2:10











  • Follow the logs. If clientData is undefined, that means something is wrong with the member property, which means the message param passed in is not what you expect

    – Sterling Archer
    Mar 25 at 2:11












  • 1





    Have you done any debugging to see why clientData is undefined?

    – Sterling Archer
    Mar 25 at 1:57











  • i have done a bit i am allot sure that it is a syntax problem but i cant seem to see the member of client data

    – Charles Evans
    Mar 25 at 2:10











  • Follow the logs. If clientData is undefined, that means something is wrong with the member property, which means the message param passed in is not what you expect

    – Sterling Archer
    Mar 25 at 2:11







1




1





Have you done any debugging to see why clientData is undefined?

– Sterling Archer
Mar 25 at 1:57





Have you done any debugging to see why clientData is undefined?

– Sterling Archer
Mar 25 at 1:57













i have done a bit i am allot sure that it is a syntax problem but i cant seem to see the member of client data

– Charles Evans
Mar 25 at 2:10





i have done a bit i am allot sure that it is a syntax problem but i cant seem to see the member of client data

– Charles Evans
Mar 25 at 2:10













Follow the logs. If clientData is undefined, that means something is wrong with the member property, which means the message param passed in is not what you expect

– Sterling Archer
Mar 25 at 2:11





Follow the logs. If clientData is undefined, that means something is wrong with the member property, which means the message param passed in is not what you expect

– Sterling Archer
Mar 25 at 2:11












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55330373%2ftypeerror-cannot-read-property-color-of-undefined%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55330373%2ftypeerror-cannot-read-property-color-of-undefined%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript