frankcollins3 / Next-Water-App

Happy, Healthy Water Cycling App that tracks user/human fluid intake.
https://next-water-app.vercel.app
1 stars 0 forks source link

type enforcement greater in nextJS 13.0.3 than react-express (same state) [11:03am] #40

Open frankcollins3 opened 11 months ago

frankcollins3 commented 11 months ago

attempting to do: iterate original react app with next, graphql, and @redux/toolkit instead of redux. Also doing a refactor for the login page since it got tangled with Oauth2.0 (everything works)

error: in the original app, the below emboldened code didn't need to be invoked within parseInt()

        if (loginstate === 'age') {       
<input onChange={inputCheckboxHandler} type="checkbox" id="parent-checkbox" style={{ display: AgeArray.includes(parseInt(AGE_INPUT)) && **parseInt(AGE_INPUT)** >= 4 && !PARENT_CONFIRM ? "" : "none", }} />
<label style={{ display: AgeArray.includes(parseInt(AGE_INPUT)) && **parseInt(AGE_INPUT)** > 4 && PARENT_CONFIRM === false ? "" : "none", }} htmlFor="parent-checkbox" className="custom-checkbox"></label>
                    {/* <p style={{ color: 'orange' }}> {PARENT_CONFIRM ? "yes" : "no" } </p> */}
                    </div>                    
                </div>
            )
        }

proposed approach: parseInt() seems to be all that is needed. This type enforcement and versioning/react/next discrepancy might keep resurfacing This happened again before where some tweaking and editing was needed but I didn't think it was big enough to create issue.

This is 2nd time the migration needs a little editing and at this point might not be the last.

// also checked original react-redux-connect reducer and the new @graphql/toolkit reducer thinking it might've been bool