notdevkey
notdevkey
Explore posts from servers
TTCTheo's Typesafe Cult
Created by machina on 9/13/2023 in #questions
Next seems to not be respecting the layout.tsx
what if you remove the "use client" from navbar?
14 replies
TTCTheo's Typesafe Cult
Created by machina on 9/13/2023 in #questions
Next seems to not be respecting the layout.tsx
hard to tell whats wrong, ima get back to u when i get home, this is an interesting one
14 replies
TTCTheo's Typesafe Cult
Created by machina on 9/13/2023 in #questions
Next seems to not be respecting the layout.tsx
thanks ❤️
14 replies
TTCTheo's Typesafe Cult
Created by machina on 9/13/2023 in #questions
Next seems to not be respecting the layout.tsx
hmm thats weird, can u show your navbar component?
14 replies
TTCTheo's Typesafe Cult
Created by machina on 9/13/2023 in #questions
Next seems to not be respecting the layout.tsx
do the children render even if the Navbar doesn't?
14 replies
PD🧩 Plasmo Developers
Created by notdevkey on 9/11/2023 in #👾extension
How do I access the current website URL from Plasmo popup?
this is a quick and ugly looking code, but it works RainbowRoach
4 replies
PD🧩 Plasmo Developers
Created by notdevkey on 9/11/2023 in #👾extension
How do I access the current website URL from Plasmo popup?
just found the solution, for anyone wondering
const [currentTab, setCurrentTab] = useState("");

useEffect(
() =>
chrome.tabs.query(
{
active: true,
currentWindow: true,
},
function (tabs) {
const tab = tabs[0];
if (tab.url) {
setCurrentTab(tab.url);
}
},
),
[chrome],
);

return (
<Switch
className="data-[state=checked]:bg-green-500"
checked={!settings.disabledHosts.includes(currentTab)}
onCheckedChange={(isChecked) =>
isChecked
? setSettings((prev) => ({
...prev,
disabledHosts: settings.disabledHosts.filter(
(host) => host !== currentTab,
),
}))
: setSettings((prev) => ({
...prev,
disabledHosts: [...settings.disabledHosts, currentTab],
}))
}
/>
)
const [currentTab, setCurrentTab] = useState("");

useEffect(
() =>
chrome.tabs.query(
{
active: true,
currentWindow: true,
},
function (tabs) {
const tab = tabs[0];
if (tab.url) {
setCurrentTab(tab.url);
}
},
),
[chrome],
);

return (
<Switch
className="data-[state=checked]:bg-green-500"
checked={!settings.disabledHosts.includes(currentTab)}
onCheckedChange={(isChecked) =>
isChecked
? setSettings((prev) => ({
...prev,
disabledHosts: settings.disabledHosts.filter(
(host) => host !== currentTab,
),
}))
: setSettings((prev) => ({
...prev,
disabledHosts: [...settings.disabledHosts, currentTab],
}))
}
/>
)
and also add
"permissions": [
"activeTab",
"tabs"
],
"permissions": [
"activeTab",
"tabs"
],
to manifest in package.json
4 replies
TTCTheo's Typesafe Cult
Created by notdevkey on 8/25/2023 in #questions
How does React Query cache values?
but thanks
7 replies
TTCTheo's Typesafe Cult
Created by notdevkey on 8/25/2023 in #questions
How does React Query cache values?
yeah I left this as a last resort, maybe someone here knows this already and could explain
7 replies
TTCTheo's Typesafe Cult
Created by manavkush on 8/24/2023 in #questions
Preventing Rerender of Parent component in React
it's not gonna slow anything down. it's good that you think about this to every single detail, but react was made to work this way so it's just fine
8 replies
TTCTheo's Typesafe Cult
Created by manavkush on 8/24/2023 in #questions
Preventing Rerender of Parent component in React
that's true, but it kinda feels like forcing the component to not re-render, opposed by not re-rendering because it's physically not tied to a state
8 replies
TTCTheo's Typesafe Cult
Created by Wezter on 8/24/2023 in #questions
Best Atlassian alternative?
for every thing you can find a guy who absolutely despises it, and that's fine 😄
78 replies
TTCTheo's Typesafe Cult
Created by Wezter on 8/24/2023 in #questions
Best Atlassian alternative?
clickup is confusing, i agree on that part
78 replies
TTCTheo's Typesafe Cult
Created by Wezter on 8/24/2023 in #questions
Best Atlassian alternative?
>> proceeds to not provide any reason as to why
78 replies
TTCTheo's Typesafe Cult
Created by Wezter on 8/24/2023 in #questions
Best Atlassian alternative?
insane
78 replies
TTCTheo's Typesafe Cult
Created by manavkush on 8/24/2023 in #questions
Preventing Rerender of Parent component in React
I really like Zustand for it's simplicity, and it solves the problem of unnecessary context re-renders
8 replies
TTCTheo's Typesafe Cult
Created by manavkush on 8/24/2023 in #questions
Preventing Rerender of Parent component in React
React context still triggers re-renders in some specific cases when it's not needed, you can search it up, there's tools like useContextSelector to handle that, or for your case I think Zustand would be best https://github.com/pmndrs/zustand
8 replies
TTCTheo's Typesafe Cult
Created by manavkush on 8/24/2023 in #questions
Preventing Rerender of Parent component in React
is the re-render causing any trouble? because in most cases it's fine. the cleanest solution would probably be to create a React context and use the context only in the subcomponents, basically eliminating state from being attached to the main chat component
8 replies
TTCTheo's Typesafe Cult
Created by Wezter on 8/24/2023 in #questions
Best Atlassian alternative?
first time hearing about shortcut. from what i see it's got quite alot of integrations
78 replies
TTCTheo's Typesafe Cult
Created by Wezter on 8/24/2023 in #questions
Best Atlassian alternative?
No description
78 replies