/wdg/ - Web Developer General

Hey guys, can anyone tell me what this kind of notification "pop-up" is called?

Attached: 2018-04-18_14-37-18.png (645x469, 21K)

banner notifications

css-tricks.com/pop-from-top-notification/

a Toast?

the benchmark game show that in 6/10 cases go is a little bit faster, in 4/10 a lot slower and everywhere it takes less RAM

Also another thing:

- this.setState({}) runs asynchronously meaning it won't necessarily update the "this.state.menuToggled" before you check it on the next line.

In your example it's actually useless to use state at all since you're not actually modifying the React DOM.

Pretty much the purpose of react is:

1. component is rendered
2. User interacts with component
3. Component updates it's state from that interaction
4. Component checks whether it should re-render (shouldComponentUpdate)
5. Component "reacts" by calling the render function again with it's updated state

In your example you're causing an unnecessary re-render if you're not going to utilize the state in your render function.

On material UI they're called toast notifications

Thanks lads.

Wait so what I ACTUALLY want to do is move it out of the class and use a normal function so it doesn't need to rerender?

Is Postman a popular utility?

I'm doing some MERN tutorial and it claims that it's a must-have that no dev can live without.

Bullshit?
Is it botnet?

You can use a typical class variable that is not "state". For example:

class X extends React.Component {
expanded = true;

set expanded(bool) {
this.expanded = bool;
// DOM manipulation possibly goes here whenever expanded changes
// document.querySelectorAll(...)
}

toggleExpand = () => {
this.expanded = !this.expanded;
}

render () {
Toggle expand
}
}


But it kind of negates the purpose of React.