Reputation: 1
Am a little of a newbie on the block and learning React - I have this segment of a function below:
AlertNotifications.prototype.render = function () {
return (React.createElement("div", null, this.props.alerts.map(function (alert) { return React.createElement(MessageBar, { messageBarType: alert.type === AlertType.Urgent ? MessageBarType.severeWarning : MessageBarType.warning, isMultiline: false },
alert.message,
alert.moreInformationUrl ? React.createElement("a", { href: alert.moreInformationUrl }, strings.MoreInformation) : ''); })));
};
return AlertNotifications;
I need to alter the fontsize of the returned DIV - can you please let me know what I need to alter - or add to the above to alter the fontsize to Arial 16px?
Many thanks in advance
G
Upvotes: 0
Views: 355
Reputation: 11
Try to use this one:
React.createElement("div", {
style: {
"font-size": "16px"
}
}, /* Put here what you need to insert in div */)
So, basically, the second attribute in React.createElement is used for attributes.
Upvotes: 1
Reputation: 305
You can add a class and style it.
React.createElement('div', {class-here}, .......)
Upvotes: 0