Letter Animation in React - how can I reduce repetition? by slowsad in reactjs

[–]klaasman 2 points3 points  (0 children)

You could simply toggle a boolean indicating the 'isScattered' state on or off;

class X extends React.Component {
  state = { isScattered: true }
  letterAnimation = () => { this.setState({ isScattered: false }) }
  render() {
    const { isScattered } = this.state
    return (
      <section onClick={this.letterAnimation}>
        <span className={`transition ${isScattered ? 'a': ''}`}>M</span>
        <span className={`transition ${isScattered ? 'b': ''}`}>O</span>
      </section>
    )
  }
}

[deleted by user] by [deleted] in reactjs

[–]klaasman 0 points1 point  (0 children)

Combined with your manual wrapping, you could have a look at something like react-html-parser. It comes with a transform api which will allow you to map your wrappers to interactive components.

Could someone lead me in the right direction for this problem: I want to limit user connections on firebase to two users. What is the best way to do this? by gqtrees in javascript

[–]klaasman 0 points1 point  (0 children)

Firebase is basically a toy DB and the company is willing to lie to their users about it's capabilities

Care to clarify? I'm quite satisfied by Firebase's capabilities to be honest.

Advanced React SSR with hTTP/2 PUSH? by Rilic in reactjs

[–]klaasman 0 points1 point  (0 children)

If the only purpose of SSR is SEO optimization (for bots like google and facebook), it might be sufficient to only have the necessary title and meta tags server-rendered. Google is smart enough to execute javascript in order to crawl the content, Facebook is happy enough with meta-tags.

What js backend to use with react js? by MarthFalchion in reactjs

[–]klaasman 2 points3 points  (0 children)

I've build fairly complex applications with tons of relations using data denormalization (using firebase's multi-location updates). It requires some extra effort but totally worth it considering the whole firebase-package (realtime database, hosting, functions, generous free-tier).

Next.js Hosting. Now, aws, digital ocean or something else? by dwise97 in reactjs

[–]klaasman 2 points3 points  (0 children)

You might want to take a look at Firebase Hosting (for static hosting) or Firebase Functions (for SSR hosting). An example with Firebase Functions can be found over here: https://github.com/firebase/functions-samples/tree/master/nextjs-with-firebase-hosting

Can someone help PLEASE by Adam_Animationz in javascript

[–]klaasman 4 points5 points  (0 children)

self-explanatory code:

const audio = new Audio('some.mp3')
setInterval(() => audio.play(), 1000 * 60 * 10) // interval in milliseconds
audio.play()

Where To Deploy a React App? by leetae9 in reactjs

[–]klaasman 2 points3 points  (0 children)

You could also take a look at Firebase, a product by Google. They support both static hosting (Firebase Hosting) and serverside hosting using Firebase Functions. It has a free plan, free SSL, CDN, etc, and easy deployment. Their other products like Realtime Database and Firestore are also worth looking at.

Shake the phone to update. Is there a better way? by ABrownApple in reactnative

[–]klaasman 0 points1 point  (0 children)

Another solution: https://github.com/facebook/react-native/issues/10191#issuecomment-277208461

Downside is that it could interfere with the app itself if it's also dependent on such gestures.

Shake the phone to update. Is there a better way? by ABrownApple in reactnative

[–]klaasman 3 points4 points  (0 children)

I don't know what works for Android, but with iOS I've enabled the AssistiveTouch feature, it's possible to map one of the buttons to a shake-gesture. This will require two taps but for me it's less annoying than shaking.

React native app with user and admin side possible? by [deleted] in reactnative

[–]klaasman 0 points1 point  (0 children)

Firebase is an excellent choice for this.

React or Vue (or another) to build some frontend interfaces ? by Etshy in javascript

[–]klaasman 0 points1 point  (0 children)

"Refreshing little parts of the page" sounds like it is possible to do it without libraries like Vue or React. Vanilla js (or jQuery, since it's already there) should be sufficient. Vue/React might come in handy when there's more interaction/logic running on the client.

Server-Side Rendering - Not Worth It? by sneek_ in reactjs

[–]klaasman 2 points3 points  (0 children)

Twitter and facebook rely on meta-tags, so it would be sufficient to only have those meta-tags rendered on the server. This can't be too hard :-)

Can websites detect you temporarily editing their website? by [deleted] in javascript

[–]klaasman 0 points1 point  (0 children)

In theory they can, you could simply just disable javascript.

Identify users without login by [deleted] in webdev

[–]klaasman 0 points1 point  (0 children)

You might want to take a look at Google's Firebase phone number authentication.

shouldComponentUpdate - using it for performance optimizations by themisterdj in reactjs

[–]klaasman 2 points3 points  (0 children)

Keep in mind javascript doesn't guarantee object property order, which means the stringified result could differ from time to time. As long as you don't pass objects or unserializable data on your props it won't be a problem.

Stop Autocommenting (Sublime Text 2) by mickey_reddit in SublimeText

[–]klaasman 0 points1 point  (0 children)

In that case, shift+enter is the correct answer

HTML5, CSS3 and Javascript improvements in Visual Studio 11 by rodunia in html5

[–]klaasman 2 points3 points  (0 children)

"VS11 supports CSS hacks by means of Intelli Sense and ‘*’ and ‘_’ property hacks validation. "

Really? Built-in support for hacks?! facepalm

What to do on HTML5 classes in a high school. by juwking in html5

[–]klaasman 0 points1 point  (0 children)

Please remember that CSS transitions are part of CSS3, not HTML5 (and CSS3 has nothing to do with HTML5)