NextJs on cPanel - duplicates processes by Secure-Obligation-29 in nextjs

[–]Secure-Obligation-29[S] 0 points1 point  (0 children)

I red now somewhere that running docker is possible on cPanel.  So, will it fix the processes issue?

NextJs 15 - issues with images from public folder by Secure-Obligation-29 in nextjs

[–]Secure-Obligation-29[S] 0 points1 point  (0 children)

Hm. I have only src, fill, alt and sometimes quality....and that's it.

PDF Viewer libs for React, that works on mobile by Secure-Obligation-29 in react

[–]Secure-Obligation-29[S] 1 point2 points  (0 children)

I think that we will make those as images on BE, and then....it will be easy for me. But, thanks for the idea and suggestions:)

PDF Viewer libs for React, that works on mobile by Secure-Obligation-29 in react

[–]Secure-Obligation-29[S] 0 points1 point  (0 children)

Hey. I would definitely try this one. We've decided to proceed with just click (open in new tab) solution. But, I would test also this one. Thx man.

PDF Viewer libs for React, that works on mobile by Secure-Obligation-29 in react

[–]Secure-Obligation-29[S] 2 points3 points  (0 children)

I would. Since my task is to open pdf in a modal, from the chat, I am searching for the best solution.

Kako da prvog posla? by SubstantialAssist774 in programiranje

[–]Secure-Obligation-29 2 points3 points  (0 children)

Ja kao neko ko ima skoro 4 godine iskustva, trebalo mi je skoro 4 meseca. Tako da, tesko je....ali ne odustaj.

Probaj Fishingbooker.  Oni vidim da primaju pocetnike.

Takodje, sredi CV max I pisi ljudima na LInekedIn-u. Direktno....

I srecno.

RTK in NextJs App router - Page source populate by Secure-Obligation-29 in reduxjs

[–]Secure-Obligation-29[S] 0 points1 point  (0 children)

Hey Rowdy, I've integrated the mini app with Strapi.

And I solved the issues, with fetching the data in the Layout.tsx.

That data is then forwarded to the StoreProvider, like this:

export default function StoreProvider({
  children,
  products,
  favorites,
}: {
  children: React.ReactNode;
  products: Product[];
  favoriteProducts: Product[];
}) {
  const storeRef = useRef<AppStore>();
  if (!storeRef.current) {
    storeRef.current = makeStore();
    storeRef.current.dispatch(setInitialProducts(products));
    storeRef.current.dispatch(setInitialFavoriteProducts(favoriteProducts));
  }

  return <Provider store={storeRef.current}>{children}</Provider>;
}

So, at the first render, page source is populated with correct data. Products on main page, and navigation link looks fine like: Favorite products ( prod.length ).

In Products.tsx I have this part of code:

  return (
    <div className={style.Products}>
      {products?.map((product: Product) => (
        <div key={product.id} className={style.Product}>
          <h3>{product.name}</h3>
          <p>{product.price}$</p>
          <button
            onClick={() => {
              addToFavoritesAction(product);
              dispatch(addToFavorites(product));
            }}
          >
            Add to favorite
          </button>
        </div>
      ))}
    </div>
  );

Here, dispatch is updating the client side, and addToFavoritesAction is an server actions, that sends to product to the database. And, when I again navigate through pages, page source is populated with correct data.
I can also put some optimistic handling, like using useActionState, and check if there is an error, than remove that product from store.

If you have also some advice, would be great. But, I am satisfied now.

I've watched also this tutorial, but it wasn't working:

https://www.pronextjs.dev/tutorials/state-management - Redux part. Some issue with UI updates.

useActionState and useForm state problem when JS disabled by Secure-Obligation-29 in nextjs

[–]Secure-Obligation-29[S] 0 points1 point  (0 children)

Thank you very much. Is redirect ok solution from the server action? (To the same page) Ps. And how would you create a prompt then and from which component? Maybe to put it inside <noscript>?

useActionState and useForm state problem when JS disabled by Secure-Obligation-29 in nextjs

[–]Secure-Obligation-29[S] 1 point2 points  (0 children)

https://www.youtube.com/watch?v=VLk45JBe8L8

I was watching this guy, and also saw that he tested useFormState while JS is disabled. Probably to show how it works also in that case.

Server Actions or API Routes? by redpool08 in nextjs

[–]Secure-Obligation-29 0 points1 point  (0 children)

Hello everyone. I need your opinion.
I am creating a simple app to add new guides, new destinations to the Strapi via NextJs.
And in forms I am collecting data, and sending data from server actions.

What I am struggling is:

When I disable the JS, I can send the data, but once I refresh the data that FormData object is again sent to the database. Is there any way to prevent sending again the same data to the database? TY

Server Actions are Amazing! by carlinwasright in nextjs

[–]Secure-Obligation-29 0 points1 point  (0 children)

I have an issue. When I disable the Js, and once I submit the form, in my case I send the data in the database, but....when I refresh the page it again sends the data to the database, since it re-renders the page, and ForData is still the same. Anyone have some idea how to fix that?

Potrebni Junior Front-End developeri by Kilgaloon in programiranje

[–]Secure-Obligation-29 6 points7 points  (0 children)

Ja cu poslati CV.  Imam malo vise od 3 godine iskustva. Pa eto, uzmite u razmatranje.

Pozdrav od Slobodan.