maskmonarch
maskmonarch
TTCTheo's Typesafe Cult
Created by voffiee on 7/28/2023 in #questions
Wordle - Word selection
Base the timestamp on UTC instead of a relative timezone
38 replies
TTCTheo's Typesafe Cult
Created by maskmonarch on 7/26/2023 in #questions
React not updating the attribute for an HTML element
i'll mark it as complete
25 replies
TTCTheo's Typesafe Cult
Created by maskmonarch on 7/26/2023 in #questions
React not updating the attribute for an HTML element
super wild though
25 replies
TTCTheo's Typesafe Cult
Created by maskmonarch on 7/26/2023 in #questions
React not updating the attribute for an HTML element
we just decided to double render both versions and hide em with CSS instead
25 replies
TTCTheo's Typesafe Cult
Created by maskmonarch on 7/26/2023 in #questions
React not updating the attribute for an HTML element
so I can directly compare it to running dev
25 replies
TTCTheo's Typesafe Cult
Created by maskmonarch on 7/26/2023 in #questions
React not updating the attribute for an HTML element
running build then start is also reproducing the error
25 replies
TTCTheo's Typesafe Cult
Created by maskmonarch on 7/26/2023 in #questions
React not updating the attribute for an HTML element
yep!
25 replies
TTCTheo's Typesafe Cult
Created by maskmonarch on 7/26/2023 in #questions
React not updating the attribute for an HTML element
const width, setWidth = useState

useEffect (() => {
setWidth(document.body.innerWidth);

const updateWidth = () => {
setWidth(document.body.innerWidth);
}

window.addEventListener('resize', updateWidth);

return () => window.removeEventListener('resize', updateWidth);
}, []);
const width, setWidth = useState

useEffect (() => {
setWidth(document.body.innerWidth);

const updateWidth = () => {
setWidth(document.body.innerWidth);
}

window.addEventListener('resize', updateWidth);

return () => window.removeEventListener('resize', updateWidth);
}, []);
25 replies
TTCTheo's Typesafe Cult
Created by maskmonarch on 7/26/2023 in #questions
React not updating the attribute for an HTML element
i'll pseudo code it, it's almost exactly this
25 replies
TTCTheo's Typesafe Cult
Created by maskmonarch on 7/26/2023 in #questions
React not updating the attribute for an HTML element
made it myself, it's nothing fancy
25 replies
TTCTheo's Typesafe Cult
Created by maskmonarch on 7/26/2023 in #questions
React not updating the attribute for an HTML element
but, then the prop updates (correctly, again, verified multitude of ways), and the component just doesn't update
25 replies
TTCTheo's Typesafe Cult
Created by maskmonarch on 7/26/2023 in #questions
React not updating the attribute for an HTML element
we make an educated guess at the width for SSR, since, well, i don't have the client. that guess is 1300 (hence why 'Search items') is visible
25 replies
TTCTheo's Typesafe Cult
Created by maskmonarch on 7/26/2023 in #questions
React not updating the attribute for an HTML element
IE: if the width is 1100, 'Search items' is showing, I need to move past 1200, then back under to get the change to show
25 replies
TTCTheo's Typesafe Cult
Created by maskmonarch on 7/26/2023 in #questions
React not updating the attribute for an HTML element
in prod, you need to move it to the correct zone, and then back to fix it
25 replies
TTCTheo's Typesafe Cult
Created by maskmonarch on 7/26/2023 in #questions
React not updating the attribute for an HTML element
in dev, it shows the correct text for the correct screen width
25 replies
TTCTheo's Typesafe Cult
Created by maskmonarch on 7/26/2023 in #questions
React not updating the attribute for an HTML element
it's just not changing the dom
25 replies
TTCTheo's Typesafe Cult
Created by maskmonarch on 7/26/2023 in #questions
React not updating the attribute for an HTML element
width is being set correctly, within that ... i've tested a console log
25 replies
TTCTheo's Typesafe Cult
Created by maskmonarch on 7/26/2023 in #questions
React not updating the attribute for an HTML element
const width = useWindowWidth();
const searchPlaceholder = width > 1200 ? 'Search items' : 'Search';
// ...
<input
type="text"
placeholder={searchPlaceholder}
/>
const width = useWindowWidth();
const searchPlaceholder = width > 1200 ? 'Search items' : 'Search';
// ...
<input
type="text"
placeholder={searchPlaceholder}
/>
25 replies