#component build

1 messages · Page 1 of 1 (latest)

cobalt wedge
#

Hello, I created a react and electron project and it works without any problems during the development process. When I build, there is no transition between pages. No components are loading

cobalt wedge
#

ok i'm looking

#

I do not understand anything

#

are u come my screen in voice channel ?

slate summit
#

no

cobalt wedge
#

😦

slate summit
#

what you don't understand?

cobalt wedge
#

anything 😄

slate summit
#

try to read again then

cobalt wedge
#

my English is not very good

#

i read 3 times and my friend read 2 timer

#

we dont understand 😄

slate summit
#

what's your first language?

cobalt wedge
#

turkish and JS

slate summit
#

ah, can't help then

cobalt wedge
#

only come voice and route we

slate summit
#

no

#

I don't speak English

cobalt wedge
#

😦 :/

#

what is your lang ?

slate summit
#

French

cobalt wedge
#

i learn french in 5 min

#

pls come voice 😄

slate summit
#

no

cobalt wedge
#

are u say always no ? 😄

slate summit
#

I mean, the docs I send can easily be translated

cobalt wedge
#

but when i apply it i don't get any results

slate summit
#

you just need to check if this could be your issue

#

then you need to share more info about your problem

cobalt wedge
#

my router page

#

Note that there is only 1 router, so I opened the project for testing purposes

slate summit
#

looks okay

cobalt wedge
#

i use hashrouter , browser router and other router

slate summit
#

except for this useEffect

cobalt wedge
#

All are working in development phase

slate summit
#

I don't see why you need this navigate

cobalt wedge
#

But when we build, there is no page and no error.

slate summit
#

how have you created your React app?

cobalt wedge
#

npx create-react-app

#

😄

slate summit
#

deprecated but ok

#

have you checked the homepage param in package.json?

cobalt wedge
slate summit
#

okay, now show me how you load your content in your BrowserWindow?

umbral musk
slate summit
#

okay, screenshot of the Network tab of your app in production?

#

If it's empty when you open it reload the page

cobalt wedge
slate summit
#

hu

#

and what result do you get exactly?

#

what do you see?

cobalt wedge
umbral musk
#

we want a router system but we work with file system in production mode

slate summit
#

remove the useEffect

#

and try again

cobalt wedge
#

sorry wait

slate summit
#

Router is no problem in production as long as you use Hash routing

cobalt wedge
#

this is correct

slate summit
#

try without the useEffect containing the navigate

#

again, I don't see why you have it

cobalt wedge
slate summit
#

.....

cobalt wedge
cobalt wedge
cobalt wedge
cobalt wedge
slate summit
cobalt wedge
cobalt wedge
slate summit
#

the screen you showed doesn't use Hash routing!

cobalt wedge
#

ok i send wait

slate summit
#

Why do you use two kinds of routers?

cobalt wedge
#

is ok ?

slate summit
#

I think you need to check react-router docs

umbral musk
#

but we dont how works hashrouter url add and remove

slate summit
#

it's either createHashRouter() or <HashRouter>, not both. Just like it's either createBrowserRouter() or <BrowserRouter>

umbral musk
#

do you have a example code

cobalt wedge
#

is ok ?

slate summit
#

ya

cobalt wedge
#

ok try build

slate summit
#

make sure you don't use another Router

#

like you showed on this App component

cobalt wedge
#

okay

#

i try wait

#

this worked

umbral musk
#

but now we dont know go another page

slate summit
#

same way you do for any React app

#

define the route

umbral musk
#

ok but how redirect

#

how added file url ex. #/home

slate summit
#

to redirect you can use useNavigate, useRedirect or <Navigate>

#

just like a normal app

cobalt wedge
#

is ok ?

umbral musk
#

can we need url started # character

slate summit
#

you don't need to worry about the # no

umbral musk
#

is there need Hashrouter is #

cobalt wedge
slate summit
#

React-router takes care of that

#

do just like you do with BrowserRouter

cobalt wedge
#

Are the last 2 pictures I posted correct?

#

If it's true, navigate doesn't work 😦

slate summit
#

try to return a Navigate component instead

#

oh sorry, I didn't see you were in a function

#

navigate should work just fine

cobalt wedge
#

i try alert

#

msg = goHomePage

#

but navigate dosent work

#

i try another wait pls

umbral musk
#

Thank you so much for everything. it was a divine help

#

now its worked

cobalt wedge
#

❤️

slate summit
#

glad you solved your problem

cobalt wedge
#

dude

#

we use tailwind

#

but not working

#

are u think a solve ?

#

okayyyy

#

we solved

#

thanksssss