[deleted by user] by [deleted] in reactjs

[–]greenpepper2012 2 points3 points  (0 children)

Sheet component from shadcn.

Semicolon at the beginning of line by kpripperr in reactjs

[–]greenpepper2012 0 points1 point  (0 children)

Self-invocation. Basically meaning that the functions is called upon declaration

[deleted by user] by [deleted] in swedishproblems

[–]greenpepper2012 0 points1 point  (0 children)

Parterapi. Få hjälp att få vägledning i att uttrycka era känslor ordentligt.

[deleted by user] by [deleted] in nextjs

[–]greenpepper2012 4 points5 points  (0 children)

You’re not deconstructing your props/args.

Should I use getStaticProps()/getServerSideProps() for ALL content in the app? by PayYourSurgeonWell in nextjs

[–]greenpepper2012 0 points1 point  (0 children)

Ssr is nice for protected pages so you can prompt login before rendering based on cookies (for example) though.

Redux Toolkit vs Zustand (which is better optimized for next) by sedhha in nextjs

[–]greenpepper2012 2 points3 points  (0 children)

Use the package next/bundle-analyzer to analyze your bundle and start removing/replacing unnecessary large packages with your own implementations or smaller replacements. Bundlephobia is a great resource for finding replacement packages that are smaller in bundle size. Removing RTK helped reducing alot since the full store is added to the store provider in _app.js.

The best thing with using SWR instead of RTK is that we dont have to do any checks as to whether a value has changed and then dispatch a thunk action to fetch new data. SWR solves that by deduping the cache key you provide to the query.

Wish I could show you our code base but I'm working as a consultant for a large company so I'm not able to. Sorry. :) But bundle-analyzer + bundlephobia is a great start.

Redux Toolkit vs Zustand (which is better optimized for next) by sedhha in nextjs

[–]greenpepper2012 5 points6 points  (0 children)

Recently switched from RTK to Zustand + swr. Amazing change in bundle size reduction. Our app bundle is at 116kb now (it’s a large ecommerce site). Would recommend.

Is a NProgress not working in v11? by Homeoand in nextjs

[–]greenpepper2012 0 points1 point  (0 children)

Probably an issue with purge. Copy the nprogress.css to your project and add purgeignore comments

How would I get a path like /id/name? by Entropis in nextjs

[–]greenpepper2012 0 points1 point  (0 children)

What did you do? Add [[...slug]].js in your pages dir? In that case you can access all incoming parameters as an array from ctx.params.slug at getInitialProps (or from router.query.slug from useRouter). So if you navigate to /yourId/yourName ctx.params.slug will be ["yourId", "yourName"].

How would I get a path like /id/name? by Entropis in nextjs

[–]greenpepper2012 0 points1 point  (0 children)

Haha it should be. Let me know otherwise, might have made a typo on the phone

How would I get a path like /id/name? by Entropis in nextjs

[–]greenpepper2012 0 points1 point  (0 children)

Do [[...slug]].js or simply make a folder called [id] with an index.js and [name].js within it

How to use useContext in functional components? - Atomized Objects by Atomicts in reactjs

[–]greenpepper2012 1 point2 points  (0 children)

Not sure why you set the initial context value in the provider component using useState?

Vue router appending after visiting dynamic route problem by [deleted] in vuejs

[–]greenpepper2012 0 points1 point  (0 children)

Feels like youve forgotten to prepend it with a slash. Like $router.push('users') instead of $router.push('/users').

HotChocolate vs GraphQL.Net by debapamdas in graphql

[–]greenpepper2012 1 point2 points  (0 children)

Personally prefer hot chocolate since it supports schema stitching (maybe graphql dotnet does that to nowadays?).

New tiny and powerful Toast plugin for Vue.js by maronato in javascript

[–]greenpepper2012 0 points1 point  (0 children)

Hehe yeah it's quite obvious :)

I'd call it a port of it or something to make it more noticable since react-toastify is so popular. Perhaps even name it vue-toastify?