-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Integration between React Starter Kit and React Bootstrap #992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Also as I said I am a bit new to reactJS and there is the possibility I am missing something. |
For example you can start using your own import React, { PropTypes } from 'react';
import cx from 'classnames';
import Link from '../Link';
class NavItem extends React.Component {
static propTypes = {
className: PropTypes.string,
href: PropTypes.string.isRequired,
active: PropTypes.bool,
disabled: PropTypes.bool,
children: PropTypes.node.isRequired,
onClick: PropTypes.func,
};
static defaultProps = {
active: false,
disabled: false,
};
render() {
const { className, href, active, disabled, children, onClick } = this.props;
return (
<li role="presentation" className={cx(className, { active, disabled })}>
<Link to={href} onClick={onClick}>
{children}
</Link>
</li>
);
}
}
export default NavItem; |
@frenzzy do you think moving to react-rooter and react-bootstrap-router is a better way to go? |
@paschalidi did you find any good solution for the link in react starter kit with react-bootstrap? Thanks in advance. |
Hi guys, please take a look at react-dashboard. We forked it from React Starter Kit and integrated react-router & bootstrap. We plan to continuously maintain it and keep it in sync with RSK. Best |
I had the exact same problem and I got it working by doing this to the base setup: Install latest versions of
|
Came accross this thread and tried this method but it didn't work for my (fairly vanilla) project. I finally got it sorted in a very easy way so thought I'd share in case it helps someone else. Add dependencies src\components\Layout\Layout.js ... and that's it! Took me a long time to figure out something really simple. |
@gruffT It's probably best to replace normalize with bootstrap since bootstrap already has normalize styles included. This works great btw. Thanks! |
@gruffT's method worked great for me, but I was wondering if anyone had run into this issue. I'm trying to import in Layout.js a .scss file that imports both node_modules/bootstrap/scss/bootstrap.scss and my own variables.scss to override some of bootstrap's default variables. In Layout.js, when I import this new .scss file, isomorphic-styles adds the "Layout" prefix to all of Bootstrap's classes. I can't figure out how to disable this or how to otherwise import this .scss file into all routes. Would appreciate any pointers. |
If I'm not mistaken, you could `import * as bootstrap from 'file.sass';`
and then export with styles and Bootstrap as an extra parameter.
…On Mar 1, 2018 20:11, "Grant Burry" ***@***.***> wrote:
@gruffT <https://github.com/grufft>'s method worked great for me, but I
was wondering if anyone had run into this issue. I'm trying to import in
Layout.js a .sass file that imports both node_modules/bootstrap/sass/bootstrap.sass
and my own variables.sass to override some of bootstrap's default
variables. In Layout.js, when I import this new .sass file,
isomorphic-styles adds the "Layout" prefix to all of Bootstrap's classes. I
can't figure out how to disable this or how to otherwise import this .sass
file into all routes. Would appreciate any pointers.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#992 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AXT1KnB2EaHSUJgQigPXpxTCH1QDKEPWks5taEfMgaJpZM4K6y0n>
.
|
Hmm, no luck from that either. Now the bootstrap styles are getting imported, but classes are still prefixed, this time with "bootstrap-". Doesn't happen when using Layout.js
boostrap.scss
|
Ok I fixed it. If anyone happens to run into this problem, this is a Webpack issue. This configuration block in
Because my Bootstrap tie-together .scss file was in
And for the block just before...
Add this directive to explicitly process the custom
One final note. If anyone tries to add in custom Sass variables to Bootstrap using this method, in your custom .scss file, switch the order of the custom /src/components/bootstrap.scss
|
@paschalidi thank you very much for crating this issue! Unfortunately, we have close it due to inactivity. Feel free to re-open it or join our Discord channel for discussion. NOTE: The |
I am a bit new to the world of ReactJS but I have been coding in Javascript for a while now. Loving what you people doing with this project! Keep making this world a better place!
A while ago I added
react-bootstrap
to this project to make my life a bit easier.I followed the tutorial from react-bootstrap and I successfully added Bootstrap.
The problem is now I cannot use the build in
<Link />
from react-starter-kit which I liked a lot because of its simplicity and "power".The official approach from react-bootstrap is to install react-router-bootstrap and replace
<Link to="/path">
with<LinkContainer to="/path">
but that means that I have to replace react-routing and universal-route with react-router, and this is something I would like to avoid.What is the right way to integrate react-bootstrap with react-starter-kit and still be able to use universal-routing? What changes should I make in order to make
LinkContainer
behave asLink
component does?When using
Link
from react-starter-kit a get this kind of errorWarning: validateDOMNesting(...): <a> cannot appear as a descendant of <a>. See Header > NavItem > SafeAnchor > a > ... > Link > a.
Related link for this issue .
(http://stackoverflow.com/questions/35687353/react-bootstrap-link-item-in-a-navitem)
The official recommendation from react-bootstrap, and react-router.
(remix-run/react-router#83 (comment))
The text was updated successfully, but these errors were encountered: