menu

React

A community of developers, designers and others who love React.js. ⚛️

Channels
Team
Show previous messages

June 28, 2020 at 10:41pm
Hi Developers, Please am finding it hard to read the URL params in my React Project after the user has click on the email link to reset password .The token is correct but am having problem here Please this is my code
class ActivitPassword extends Component { constructor(props) { super(props); this.state = { password: '' } this.handleChange = this.handleChange.bind(this) this.onSubmit = this.onSubmit.bind(this) this.token = this.token.bind(this) } handleChange =input => (event)=>{ event.preventDefault() this.setState({[input]: event.target.value}) } componentDidMount(){ this.token() } token = ()=>{ const token = this.props.match.params.token return token } onSubmit = (event)=>{ event.preventDefault() const saveLinkPassword = { password: this.state } event.preventDefault() axios.post(http://localhost:8000/user/activtypassword/:${this.token}, saveLinkPassword).then(res => res.json()).then(res => {toast.success("Password Update") }).catch(err => {toast.error(err.response.data)}) } render() { return ( <div className='passwordForgot'> <ToastContainer /> <h1>ENTER NEW PASSWORD</h1> <div className='recoverInput'> <label>PASSWORD: </label> <input placeholder='password' name="password" onChange={this.handleChange("password")}/> </div> <button className='btn btn-success' onClick={this.onSubmit}>Save Password</button> </div> ); } }
  • reply
  • like
Hi Developers, Please am finding it hard to read the URL params in my React Project after the user has click on the email link to reset password .The token is correct but am having problem here Please this is my code
class ActivitPassword extends Component { constructor(props) { super(props); this.state = { password: '' } this.handleChange = this.handleChange.bind(this) this.onSubmit = this.onSubmit.bind(this) this.token = this.token.bind(this) } handleChange =input => (event)=>{ event.preventDefault() this.setState({[input]: event.target.value}) } componentDidMount(){ this.token() } token = ()=>{ const token = this.props.match.params.token return token } onSubmit = (event)=>{ event.preventDefault() const saveLinkPassword = { password: this.state } event.preventDefault() axios.post(http://localhost:8000/user/activtypassword/:${this.token}, saveLinkPassword).then(res => res.json()).then(res => {toast.success("Password Update") }).catch(err => {toast.error(err.response.data)}) } render() { return ( <div className='passwordForgot'> <ToastContainer /> <h1>ENTER NEW PASSWORD</h1> <div className='recoverInput'> <label>PASSWORD: </label> <input placeholder='password' name="password" onChange={this.handleChange("password")}/> </div> <button className='btn btn-success' onClick={this.onSubmit}>Save Password</button> </div> ); } }
  • reply
  • like

July 2, 2020 at 5:22pm
I'm new to the world of computer science.
  • reply
  • like
And, I have a question.
  • reply
  • like
I have made a JS library for React. Should I make it open-source or not.
  • reply
  • like

July 3, 2020 at 9:20am
Depends on your preference, if it is good enough. But, open source mean someone else get to use it.
  • reply
  • like

July 3, 2020 at 11:24pm
Yea, open source basically allows others to use and contribute to it. So if that's what you want then yes.
  • reply
  • like

July 11, 2020 at 7:10am
npm start not working right after create-react-app. it gives 7 steps to solve the problem but it does not help
  • reply
  • like

July 12, 2020 at 6:12pm
تست
  • reply
  • like
salam
  • reply
  • like

July 13, 2020 at 3:40pm
hello
  • reply
  • like
can someone help me and explain how i use makestyles classes inside this: export default class HomePageSlider extends React.Component{...}
  • reply
  • like

July 14, 2020 at 1:26am
Hi, is it safe to set refresh token to redux state for persistent session in React Native? Any help would be appreciated. https://stackoverflow.com/questions/62877680/is-it-safe-to-set-refresh-token-to-redux-state-for-persistent-session-in-react-n
  • reply
  • like

July 20, 2020 at 11:37pm
People here are probably mostly using Redux but I want to learn Mobx. I can only see things with React/classes. Since I only want to use React/functions, any advice where to find a tuto on Mobx/observable/observer but with functions?
  • reply
  • like

July 23, 2020 at 2:11pm
I have craeted one component which takes data from api and render it. But can I separate out section inside map in separate component and use it inside parent component?
yes, you can
  • reply
  • like

July 25, 2020 at 2:15pm
How to render a dropdown based on checkbox selection on change event
  • reply
  • like

July 25, 2020 at 10:25pm
use an hidden select tag and simulate events so it stays accessible
  • reply
  • like

July 28, 2020 at 6:34pm
Hi Everyone! Nice to meet you guys!
I'm trying to create the react component as a package locally and not to publish. Could anyone please provide the link or blog to achieve this, it will be really helpful! Thanks in advance.
  • reply
  • like

July 30, 2020 at 12:46pm
You can publish it and make it private
  • reply
  • like

August 2, 2020 at 8:05am
Hi, does Native-Base FooterTab supports lazy load? is there a difference in performance between React Navigation createBottomTabNavigator and Native-Base FooterTab?
  • reply
  • like

August 6, 2020 at 9:06am
https://dpaste.org/Ni79 Anyone can please help me in fixingPrivateRoute
  • reply
  • like

August 7, 2020 at 12:40pm
I am trying to do 404 page then I am getting rendered component and 404 page on the same page I don't know what's going wrong and for the wrong url the 404 is just working fine
  • reply
  • like

August 15, 2020 at 12:06pm
I am getting status 200 but data is not loading ?How to resolve?
  • reply
  • like

August 17, 2020 at 9:58am
Show more messages