react-boilerplate

How to create Anchor Tag in react-router?

感情迁移 提交于 2020-01-02 18:03:50
问题 I am using react-boilerplate (3.4.0) with react-router internally for the routing. I have tried to create a Link with : < a href="#anchor-tag" >< /a > When I click on it I expect to scroll to the div with id=anchor-tag It just scroll to the top of the page, even if I use a Link component instead of a < A > tag. Does we have to care about use < A > or < Link > ? How should we create anchor tag in react-router ? 回答1: This might be a while late but what you can do is add this to your component:

substate.get() is not a function using React Boilerplate

核能气质少年 提交于 2019-12-23 20:15:36
问题 I have a component called Login, and these selectors: const selectLogin = () => (state) => state.get('login'); const selectUser = () => createSelector( selectLogin(), (loginState) => loginState.get('user') ); Here's what state looks like for the "login" component: login: { user: { id: 206 } } In another component, I want to select the "user" object. At the top of my file, I have import { createStructuredSelector } from 'reselect'; import { selectLogin, selectUser } from 'containers/Login

redirect to other page after authentication react

為{幸葍}努か 提交于 2019-12-20 04:38:46
问题 I'm building react application using react-boilerplate. I have created authentication containers using react-boilerplate generator features and combine it with this public api . It will return token after we passed email & password. How to redirect to other component / page after set the token to browser localStorage ? Thank you for your time. reducers.js import { fromJS } from 'immutable'; import { CHANGE_EMAIL,CHANGE_PASSWORD,LOGIN_REQUEST, LOGIN_SUCCESS, LOGIN_FAILURE } from './constants';

Css classname not applied to react component

半城伤御伤魂 提交于 2019-12-10 07:08:57
问题 I appreciate your time and help. I spent hours trying to figure this out can't seem to get to the bottom of it. I have this react component: import styles from './style.scss'; class ButtonComponent extends React.Component { render() { return ( <div className={styles.bunny}> hello world </div> ); } } and scss file: .bunny { display: block; margin-top:50px; margin-bottom:55px; background-color: blue; } When I load up my html, the div has no classname when I expect it to be <div class="bunny">

Getting Started with React-Hot-Loader

笑着哭i 提交于 2019-12-08 12:13:31
问题 I am trying to use React Hot Loader in React. I installed react hot loader by running "npm install --save-dev react-hot-loader". I tried to follow the http://gaearon.github.io/react-hot-loader/getstarted/ but couldn't understand. I am attaching my webpack.config.js and package.json. I made changes as listed in document. But I am not able to see the changes I make in components on the fly. What is wrong? webpack.config.js var path = require('path'); var webpack = require('webpack'); module

Css classname not applied to react component

邮差的信 提交于 2019-12-05 14:06:23
I appreciate your time and help. I spent hours trying to figure this out can't seem to get to the bottom of it. I have this react component: import styles from './style.scss'; class ButtonComponent extends React.Component { render() { return ( <div className={styles.bunny}> hello world </div> ); } } and scss file: .bunny { display: block; margin-top:50px; margin-bottom:55px; background-color: blue; } When I load up my html, the div has no classname when I expect it to be <div class="bunny"> When I put the class name in the react component literally like this: <div className="bunny"> then I can

redirect to other page after authentication react

早过忘川 提交于 2019-12-02 03:02:41
I'm building react application using react-boilerplate. I have created authentication containers using react-boilerplate generator features and combine it with this public api . It will return token after we passed email & password. How to redirect to other component / page after set the token to browser localStorage ? Thank you for your time. reducers.js import { fromJS } from 'immutable'; import { CHANGE_EMAIL,CHANGE_PASSWORD,LOGIN_REQUEST, LOGIN_SUCCESS, LOGIN_FAILURE } from './constants'; const initialState = fromJS({ email: '', password: '', isFetching: false, isAuthenticated: false,