How to add React.lazy?

good afternoon guys

My site was rated 60-69 (mobile) on pagespeed test

I managed to modify the react.lazy code and the grade went to 77-85

The problem is the code appears visibly above the header.

Where am I going wrong, would someone know please?

I can’t add the code and I can’t inform my site.

my site is tiparticular (dot com dot br)

1 Like

I’m not sure I understand what you’re trying to do.
If the goal is to improve your Wix site performance, you can’t do it by importing React modules.

Hi JD,

I’m trying to follow pagespeedtest’s recommendations to improve the mobile site’s rating

with the code attached, apparently improved, but the code keeps appearing above the head.

you said it is not possible to use react.lazy. With your experience, which codes are possible and good to improve my grade?

Could you please help me with this! I’ve been reading for 3 weeks, trying to improve everything I can.

In Wix>Additional meta tags, If i use preload, preconnect, prefetch with ; does not bring satisfactory stability

It seems better to use wix>configuration>custom code

Am I on the right track?

From now on, I appreciate your attention.

Cezar Augusto

With Wix, you’re not supposed to add libraries by yourself in order to improve performance. Wix should do it for you.
If you try importing external libraries it might even make the performance worse.
What you can do on your side is handle your data retrieval correctly.

P.S. If you see the code on the page, you probably haven’t wrapped it in tags.

JD, I understand what you say and I expected something like this.

Funny, when I didn’t use the grade went up from 60-69 to 80-85 and when I used the grade stayed the same. I write this for you, as I only have basic notions of code and for this reason it seems like a discovery for those who do not understand about it.

even so, thank you very much

Cezar

@cezartiparticular
Already have seen this post…?

1 Like

@cezartiparticular , I think the improvement you saw was just a temporary coincident.

@russian-dima Hi Velo

I have not seen it! Looking now, the site he refers to is more complex and the score he seeks to increase refers to computers, not cell phones

If you pay attention and test the Apartments Near Me website on the pgaspeed test, you will see 36 on mobile and 97 on computer.

For the author of the topic to improve, apparently he needed to use java. wix>advanced>I see what would be more complex for me today, if the code doesn’t come chewed.

thank you for the help

@jonatandor35

I think the same as you. I tested it 5 times in a row and the result ranged from 77-85.

After removing the code and adding it a day or two later, the result is no longer the same

let me do a test and post it here later