Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Html's "align" attribute is not supported in ReactJS

Tags:

html

reactjs

I'm new to ReactJS. In the react component, I've

    var SaveOrganization = React.createClass({
    render: function () {
    return (
        <div className="box-footer" align="center"> 
            <a href="addVenue" className="btn btn-info bottom-margin" >Add Venue</a>
            <a href="addCourt" className="btn btn-info bottom-margin" >Add Court</a>
            <a href="addPOI" className="btn btn-info bottom-margin" >Add POI</a>                    </div> 
    );
}})

But when I see the browser after rendering "align" attribute doesn't show up at all. Please help me on this.

like image 344
User1230321 Avatar asked Dec 14 '22 05:12

User1230321


1 Answers

Yes, it seems that align is not supported by React. Here is the full list.

I'd suggest using style (or css) instead:

return (
    <div className="box-footer" style={{textAlign:"center"}}> 
        <a href="addVenue" className="btn btn-info bottom-margin" >Add Venue</a>
        <a href="addCourt" className="btn btn-info bottom-margin" >Add Court</a>
        <a href="addPOI" className="btn btn-info bottom-margin" >Add POI</a>                    </div> 
);
like image 73
Davin Tryon Avatar answered Dec 29 '22 15:12

Davin Tryon