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;
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
add a comment |
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
1
Have you done any debugging to see whyclientData
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. IfclientData
is undefined, that means something is wrong with themember
property, which means themessage
param passed in is not what you expect
– Sterling Archer
Mar 25 at 2:11
add a comment |
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
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
reactjs
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 whyclientData
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. IfclientData
is undefined, that means something is wrong with themember
property, which means themessage
param passed in is not what you expect
– Sterling Archer
Mar 25 at 2:11
add a comment |
1
Have you done any debugging to see whyclientData
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. IfclientData
is undefined, that means something is wrong with themember
property, which means themessage
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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 themember
property, which means themessage
param passed in is not what you expect– Sterling Archer
Mar 25 at 2:11