Topic: Need help for basic reactmdb setup with create-react-app.
nikroomancer free asked 6 years ago
Jakub Strebeyko staff answered 6 years ago
Hi there nikroomancer,
Thanks for submitting the question to our forum! The steps you have taken were mostly correct. Let's walk through it together, from the beginning:
1. create-react-app yourappnamehere
2. cd yourappnamehere
3. Add mdbreact
as a dependency to the package.json (the #react-upgrade
one)
4. yarn
/ npm
shall install all the dependencies. Note, that mdbreact
itself includes Bootstrap (4.0.0-beta.2
) as its dependency. Once all of it is out of the way,
5. time to modify your App.js
file. To utilize full power of MBD React
there, you need to import components you would like to use, for example
import {Button, NavbarBrand, Navbar, NavbarNav, NavItem} from 'mdbreact';
and secondly, you need proper CSS files. As MDB partially builds upon Bootstrap, it's safest to include both:
import '../node_modules/bootstrap/dist/css/bootstrap.min.css';
import '../node_modules/mdbreact/docs/css/mdb.min.css';
As you can see, there is no jQuery involved. The warning popping out during npm install
/ yarn
stems out of Bootstrap itself and the fact it requires jQuery by default - nothing to worry here - no ejecting either. Hope it helps.
With Best Regards,
Kuba
nikroomancer free commented 6 years ago
Thank you! This seems to have done the trick. I did notice that the navbar doesn't seem to have the ripple highlight effect as in the example and the dropdown doesn't fade in, it just appears. Is this because it needs to be mdb react pro? I used the first basic react navbar example with the code provided on from your webpage. On the example it has the effects but they seem to be missing on the sample code implementation.Jakub Strebeyko staff commented 6 years ago
Hi there, Happy it helped. :) When it comes to a particular component's effects, they might be optional or even added up in PRO version, but copying code should suffice to get the presented appearance. Thanks for you noticing now we know the snippets on the docs page are somehow flawed. Fixing it has been added to our development list and should be fixed soon enough. With Best Regards, KubaFREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Free
- Premium support: No
- Technology: MDB React
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: Yes