reactjsdirection

Reactjs doesnot allow dir="rtl" to show text RTL


.rtl{
      direction: rtl;
     }

 <Col lg="9" md="8" sm="7">
                                    <div className="blog-details-box">
                                        <div className="blog-details-banner">
                                            <img src={process.env.PUBLIC_URL + `/assets/images/${Datas[blogId].postImg}`} alt="" className="img-fluid" />
                                        </div>
                                        <div className="heading" dir="rtl">
                                            <h4 className="rtl">{Datas[blogId].postTitle}</h4>
                                        </div>
                                        <div className="blog-auth_date d-flex">
                                           
                                        <div className="author-img d-flex">   
                                            <p><Link to={process.env.PUBLIC_URL + "/"}>{Datas[blogId].authorName}</Link></p>
                                      </div>
                                            <div className="post-date">
                                                <p><i className="las la-calendar"></i> {Datas[blogId].postDate}</p>
                                            </div>
                                           
                                        </div>


                                        <div className="blog-details-desc">
                                            <p> {Datas[blogId].postContent}</p>
                                           
                                        </div>
                                      
                                        

                                     
                                    </div>
                                </Col>

I am trying to show some urdu text on one of my page only. I have tried applying dir="rtl" on my

tags but it doesnot work. I have tried using react-with-direction but it only change the position of all the items on my component and doesnot change anything about the text itself. Right now it look like it does in the picture below, in this code the tag should show the text in rtl


Solution

  • I used text alignment right to make it work but not sure if thats a good practice or not.