Closed BenocxX closed 3 months ago
Try importing the black theme and then look at the elements. It seems that the slides initialized which means stuff should be there.
import 'reveal.js/css/theme/black.css'
Also, make sure the h-screen
& #root
divs cover the whole screen or a significant part of it. This was all I needed to get it working.
I ran your code and my setup did not like the way you setup createRoot and hotreloading doesnt work unless you put the App component in another file. So I suggest doing that to eliminate any other hindrances.
Thanks for the quick answer!
Do you have an example repo I could check out? I created a brand new project and followed the README and made sure my div
covered the whole screen, yet it does not work in production, only in dev mode... I also move the App component in it's own file. I kept the default createRoot
setup that's there when you create a new React project with Vite. I'm probably doing something wrong, I'd like to check a full example to spot the problem.
Also for the theme, I get the following error when I import:
import 'reveal.js/css/theme/black.css'
That being said, I can import it like this:
import "reveal.js/dist/theme/black.css";
Yes, actually there are a few new issues that I have uncovered thanks to investigating your issue.
react-reveal-slides
and when said file was finished loading, the opacity of the slides would transition to 1. Point 2 is the reason you dont see anything. In your console, it shows that the theme loading failed and so the slides are left completely transparent. They are there but are invisible.
I have added a temporary work around that will be in the next version of the package.
For now, a quick fix for you is to force the opacity of .reveal-viewport
to 1. Basically, anywhere in the css add
.reveal-viewport {
opacity: 1!important;
}
Once the new version of the package is up on npm, then you can just update to the latest and the issue should be gone. I just need to do some testing to make sure everything is good.
Awesome! Thanks a lot for the really quick fix!
I made a basic React (SWC) project using Vite.
I have the following main.tsx:
When I run
npm run dev
it works correctly but when I build the project nothing is shown.I run:
I get:
Thanks for the help :)