Axnyff

Axnyff

Member Since 7 years ago

Experience Points
2
follower
Lessons Completed
0
follow
Lessons Completed
14
stars
Best Reply Awards
4
repos

2533 contributions in the last year

Pinned
⚡ mal - Make a Lisp
Activity
Apr
13
1 month ago
Activity icon
issue

Axnyff issue gatsbyjs/gatsby

Axnyff
Axnyff

Using the typeof window === 'undefined' check seems to lead to weird rendering issues

Preliminary Checks

Description

Hello,

I have a weird issue whenever I use typeof window to do a check for the ssr. The component is then not properly rendered

export const Phone = () => {
  const [isLightTheme, setIsLightTheme] = useState(
    typeof window !== "undefined"
  );
  useEffect(() => {
    setIsLightTheme(true);
  }, []);
  return (
    <a className={isLightTheme ? "text-white" : "text-dark"}>
      <div>{isLightTheme ? "text-white" : "text-dark"}</div>
    </a>
  );
};

My component looks like this, after the hydration, the text will correctly turn to text-white however, the className won't change

Reproduction Link

https://github.com/Axnyff/reproduction-gatsby

Steps to Reproduce

  1. yarn && yarn build && yarn serve
  2. Go to a browser to http://localhost:9001

Expected Result

The whole component should correctly be rerendered

Actual Result

text-dark will turn to text-white however, the className of the phone number will stay as text-dark

Environment

System:
    OS: Linux 5.13 Ubuntu 20.04.3 LTS (Focal Fossa)
    CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 16.1.0 - ~/.nvm/versions/node/v16.1.0/bin/node
    Yarn: 1.22.17 - ~/.nvm/versions/node/v16.1.0/bin/yarn
    npm: 8.5.5 - ~/.nvm/versions/node/v16.1.0/bin/npm
  Browsers:
    Chrome: 98.0.4758.80
    Firefox: 98.0.2
  npmPackages:
    gatsby: 4.11.2 => 4.11.2

Config Flags

I have no flag and no gatsby-config

Activity icon
created branch
createdAt 1 month ago
Activity icon
created repository
createdAt 1 month ago
Mar
30
1 month ago
Activity icon
issue

Axnyff issue comment paulrosen/abcjs

Axnyff
Axnyff

My drum gift after asking so much questions !

Hey @paulrosen Here is my gift for you, I just recreated the drum sound by creating a new one 😄

If you like it, let me know, I will send you the files I changed 👍

https://user-images.githubusercontent.com/85546423/154319704-dcfaa3f6-171e-4957-b759-e4c07514ae73.mp4

Axnyff
Axnyff

@airdev-web Hey, I'm struggling to understand how to create great scores and sound. I'm really curious to understand how you managed to do it.