title: Conditional css in react/Next js
body: <p>I am using Next js,I am applying conditional on component which is working,but css style changes between different component.</p>
  <p>Code 1:</p>
  <pre><code>import React from &quot;react&quot;;
  import Profile from &quot;../../components/model/Profile&quot;;
  import { useAuthContext, useAuthUpdateContext } from &quot;../../app/AuthContext&quot;
  
  function profile() {
    const user = useAuthContext()
    const { updateUser } = useAuthUpdateContext()
  
    return user.isLoggedIn === true &amp;&amp; user.user.userType === &quot;Model&quot; ? (
      &lt;div&gt;
        &lt;Profile /&gt;
      &lt;/div&gt;
    ) : (
      &lt;div className=&quot;&quot;&gt;
        &lt;h1&gt;You are not authorized to view this page&lt;/h1&gt;
        {/* tw-mx-auto tw-mt-auto tw-font-extrabold tw-capitalize tw-text-3xl */}
      &lt;/div&gt;
    )
  }
  
  export default profile;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/rsMkQ.png" rel="nofollow noreferrer">Image of code 1 style</a></p>
  <pre><code>import React from &quot;react&quot;;
  import Profile from &quot;../../components/model/Profile&quot;;
  import { useAuthContext, useAuthUpdateContext } from &quot;../../app/AuthContext&quot;
  
  function profile() {
    const user = useAuthContext()
    const { updateUser } = useAuthUpdateContext()
  
    return user.isLoggedIn === true &amp;&amp; user.user.userType === &quot;Model&quot; ? (
      &lt;div&gt;
        &lt;Profile /&gt;
      &lt;/div&gt;
    ) : (
      &lt;div className=&quot;tw-mx-auto tw-mt-auto tw-font-extrabold tw-capitalize tw-text-3xl&quot;&gt;     &lt;-----// Difference is here from code 1 
        &lt;h1&gt;You are not authorized to view this page&lt;/h1&gt;
        {/* tw-mx-auto tw-mt-auto tw-font-extrabold tw-capitalize tw-text-3xl */}
      &lt;/div&gt;
    )
  }
  
  export default profile;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/qYkp3.png" rel="nofollow noreferrer">Image of code 2 style</a></p>
  <p>Components are working as expected but css style not.</p>