safak / next-blog

326 stars 329 forks source link

dangerouslySetInnerHtml error fixed #22

Open mozi47 opened 1 year ago

mozi47 commented 1 year ago

This error appear when you dont have any data in the database and I add this condition to prevent this error:

{typeof data?.desc === 'string' &&
          <div
            className={styles.description}
            dangerouslySetInnerHTML={{ __html: data?.desc }}
          />
        }