Comments (4)
I've been trying to keep the dependencies for this component to a minimum, otherwise I probably would have used react-router <Link \>
. Instead, the method I recommend is making use of the onClick
property to pass something like a react-router push
. I've used that on a project I was working and it eliminated the effect you mentioned.
from react-adminlte-dash.
I tried this
<Sidebar.Menu header="MAIN NAVIGATION" key="3"> <Sidebar.Menu.Item icon={{ className: 'fa-calendar' }} title="Calendar" onClick={browserHistory.push('/scheduled')} /> </Sidebar.Menu>
but i get errors -- Cannot update during an existing state transition (such as within render
or another component's constructor). Render methods should be a pure function of props and state; constructor side-effects are an anti-pattern, but can be moved to componentWillMount
.
from react-adminlte-dash.
again this is an awesome react-adminLTE dashboard!!
just in case any other beginners need it. i imported browserhistory and
onClick={() => browserHistory.push('/scheduled')} the key was this thing () => bc i was getting ReactJS: Warning: setState(…): Cannot update during an existing state transition ...
i am using react router 3 with vulcanjs !!!
from react-adminlte-dash.
Glad you could make it work for you.
You are correct, you need to provide a function to events like onClick (or onBlur, etc) instead of a function call. The function call would be activated while rendering the page, causing the error you were seeing. You can either use onClick={() => browserHistory.push('/')}
or onClick={function() {browserHistory.push('/')}}
.
Closing this issue as solved.
from react-adminlte-dash.
Related Issues (15)
- Possible to start Dashboard with sidebar toggle off HOT 2
- how to show notification icon in the header nav-bar
- Change Text style of Sidebar.Menu.Item 'title' and icon
- `context.__styled-components__` as a function is deprecated. It will be replaced with the object on `.context.__styled-components__next__` in a future version.
- Is the AdminLTE styles/skins configurable in your project for future AdminLTE updates?
- Component Swap Out
- SSR + customization + typing HOT 2
- Implement new component using existing theme HOT 5
- Possible to insert a footer? HOT 2
- how to include font-awesome in pages which are not using the adminlte HOT 1
- ReferenceError: window is not defined using vulcanjs framework HOT 2
- font-awesome icon and title not shown on navbar Header.Item HOT 1
- no-print HOT 2
- toggling programmatically HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-adminlte-dash.