What do you want to save?
Add Code snippet
New code examples
-
Other 2022-03-02 23:20:18
Getting data from one axios to another in componentDidMount
componentDidMount() { const { match: { params } } = this.props; axios .get(`/api/topics/${params.TopicId}`) .then(response => { this.setState({ topic: response.data }); return axios.get(`/api/users/${response.data.user_id... Add solution -
TypeScript 2022-02-28 04:10:01
ts react props type
// Declare the type of the props type CarProps = { name: string; brand: string; price; } // usage 1 const Car: React.FC<CarProps> = (props) => { const { name, brand, price } = props; // some logic } // usage 2 const Car: React.FC<C... Add solution -
Javascript 2022-02-27 10:25:05
react ref
const FancyButton = React.forwardRef((props, ref) => ( <button ref={ref} className="FancyButton"> {props.children} </button> )); // You can now get a ref directly to the DOM button: const ref = React.createRef(); <Fanc... Add solution -
Other 2022-02-23 02:15:04
slot-scope vue
<div id="app"> <input type="text" v-model="text" @keyup.enter="addItem"> <list :items="items" @delete="removeItem"></list> <list :items="items" @delete="... Add solution