React unexpected token

import { useState } from 'react';

const Homepage = () => {

  return (  );
export default Homepage;

// please guys tell me where the problem stands . Im really confused
//it says the problem stays at the second return bracket          return();

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

can you give the whole error? explain what your question is?

it says unexpected token at the second return bracket

What are you attempting to return here?

Yeah, I think it’s a JS problem. When it sees those parentheses it is expecting an expression. If I go return;, it works fine. If you want to return undefined there, that can work (I use it with return early patterns all the time), just don’t use parentheses unless there is a valid expression inside.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.