React-Redux on codepen

Hi guys!

Just beginning the setup for a 25 & 5 timer on Codepen using React and redux and can’t get anything to run. Codepen isn’t rendering the component - can’t even get a log to the console.
Can anyone tell me why?

Thanks!

Check your reducers.
For example, what is this syntax?:

    case DECREMENT:
      return
      ...state,
        state -1;

Thanks @jenovs for your reply :slight_smile:
I’ve re-written my reducers, but still no joy. Do they look correct to you?

Line 28 missing =:

const initialState {
                  ^

Thank you :+1:
Crazy that anything broken on the Redux side will just flat out prevent any render on the React side. Makes debugging difficult no?
I presumed as long as I have a react component and a ReactDOM.render() I would get a render regardless of whatever else is going on.

Can you tell me why I’m getting empty props in the react components?

JavaScript is read line by line, so if the program that parses the code (ie that part of the browser) reaches that bit of the code first then that bit will break the code. The parser has reached that first because it comes before all the other code.

If you have a syntax error, it will just flat out break the code every time, nothing to do with redux or any other library. The error will tell you where it was triggered, but a syntax error means the code isn’t parse-able as code, the program can’t recover from it.

It doesn’t really make debugging difficult, it makes it easier: if the code is not code, then it should not run, it should blow up immediately.

ahh yes ok, that makes sense thank you :slight_smile:

1 Like