show a feature through exporting in a react component

I'm currently learning React by tackling a problem in React. Below is the React code challenge I'm working on. However, I encountered an error in the browser that I couldn't resolve even after searching on Google. I've included my code below along with a link to StackBlitz. Can someone please assist me?

Property 'stateDropdown' does not exist on type 'JSX.IntrinsicElements'.(2339)

https://stackblitz.com/edit/stackblitz-starters-ngl4yu?description=React%20%20%20TypeScript%20starter%20project&file=src%2Fcomponents%2FstateDropdown.tsx,src%2Fcomponents%2FstateDropdown.css,src%2FApp.tsx&title=React%20Starter

import { FC } from 'react';

import './style.css';
import { stateDropdown } from './components/stateDropdown';

export const App: FC<{ name: string }> = ({ name }) => {
  return (
    <div>
      <stateDropdown />
      <h1>Hello {name}!</h1>
      <p>Start editing to see some magic happen :)</p>
    </div>
  );
};

Coding challenge https://www.youtube.com/watch?v=V2zEAXLQbF4&t=794s

Answer №1

When creating user-defined JSX components (like StateDropdown), it is recommended to use PascalCase instead of camelCase. This helps JSX distinguish between custom components and HTML elements (e.g. <div>, <h1>, <p>, etc.).

import { FC } from 'react';

import './style.css';
import { StateDropdown } from './components/StateDropdown';

export const App: FC<{ name: string }> = ({ name }) => {
  return (
    <div>
      <StateDropdown />
      <h1>Hello {name}!</h1>
      <p>Start editing to see some magic happen :)</p>
    </div>
  );
};

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The React JSS element selector allows you to target the current element using `&element`

Is there a React JSS styling syntax equivalent for targeting the current element? '&element': { margin: 0 } Scenario I have defined styles for all <Button> components in my application. '&:first-of-type': { marginLeft: 0 ...

Is Jquery compatible with your Wordpress theme?

My current wordpress version is 3.4.1 and I want to include jQuery in my custom wordpress theme. Despite trying multiple solutions found online, I have been unsuccessful in implementing it convincingly. Can someone please provide a simple example to help ...

What could be causing the Navbar Icon to not show up on my website?

Teaching myself HTML & CSS has been a challenging journey. Despite purchasing several books that I have barely read, I am persevering through the problems I encounter. StackOverflow has been a lifesaver, and since you all helped me with my last issue, I fi ...

Issue with Material UI: Background elements inaccessible while MUI Dialog is active

Currently, I am in the process of styling a Chatbox using MUI and encountering an issue. When the Dialog is open, I am unable to interact with the background elements. Although I can click on the content within the Dialog, I cannot access the background Fo ...

Angular JS promise not fulfilling its return obligation

I am a beginner in Angular JS and encountered an issue while trying to load a JS file in a cshtml extension. I was able to alert the message 'testing 1' but not 'testing 2'. Can someone help me understand what might be causing this issu ...

Discovering visible ID numbers on the screen

My content includes the following: <div id="sContainer"> <div class="message0" id="l0">Initial Content 111</div> <div class="message1" id="l1">Initial Content 222</div> <div class="message2" id="l2">Initial ...

What is causing the image to move to the following line?

(https://i.stack.imgur.com/5oi7s.png) The image appears to be shifting to the next line inexplicably. I have experimented with various methods to address this issue, including utilizing the built-in Image component which seemed to show improvement. However ...

Utilizing the Jquery hover feature to reveal or conceal an element

My Hover function is designed to display and hide sub menus when a person hovers on them. The issue I'm facing is that the menu disappears when I move the mouse down towards it. Can someone help me identify what I am doing wrong here? ...

Troubleshooting problems with AJAX in WordPress

I have been attempting to transfer an array from PHP to JavaScript in order to display search results from a database. After converting the array into JSON format, I am facing difficulties in retrieving it. Despite having colleagues experienced in AJAX, we ...

Is anyone else seeing a mysterious gray outline surrounding the image?

When visiting my website, I encountered an issue with the main menu. Specifically, when hovering over 'Populaire boeken', the first 2 menu items display properly with an image on mouseover. However, there seems to be a pesky grey border surroundi ...

Issue with prolonged CSS transition duration affecting width and position changes

Suppose we need a transition for width and position. However, using a long duration can result in unexpected behavior. The timing function will reset from zero for the remainder of the operation. #test { border: solid 1px; width: 100px; ...

The issue occurs when using z-index: -1 in Google Chrome causes links to malfunction

Recently, I encountered an issue with Chrome. When I applied a z-index of -1 to a position: relative; unordered list, the links within it became unclickable. You can see an example at http://jsfiddle.net/raLnx/ using Chrome 20.0.1132.47m. There is no pro ...

Toggle the input box by clicking the button

How do I show or hide the input box (blue square) when I click the search button (red square)? Link Image I attempted to create the transition in CSS and also experimented with JavaScript, but the JavaScript part confused me. Here is what I tried: $(" ...

What steps should I take to execute JavaScript within the WebBrowser control?

Within my winforms application, there is a WebBrowser control named webBrowser1. In the code, all I have added is navigation to a specific page: private void Form1_Load(object sender, EventArgs e) { webBrowser1.Navigate("http://localhost:6489/Default ...

Leveraging Vue Data for Storing CSS Properties

I am currently utilizing the Quasar framework in conjunction with Vue for my application development. Below is a snippet of my code: <q-tooltip content-class="bg-amber text-black shadow-4" :offset="[10, 10]"> Save </q-tooltip> <q-tooltip c ...

The remove button in the cart is malfunctioning when attempting to delete a product. I have implemented ajax for this feature, but it

This button allows users to remove a product from their cart using AJAX: cart.hbs <button href="/remove-product" id="{{this.product._id}}" class="btn btn-danger" onclick="removeProduct ,('{{this.product._ ...

Cannot load the next page using jQuery ajax

I am working on a project with an index.html file that includes a nav menu, header, footer, and a div.content where jQuery is used to parse the html of page1.html. Initially, page1.html loads perfectly. However, I encountered an issue when trying to imple ...

css allow inline-block elements to fill the entire width of their container

Well, here's the thing - it's a bit complicated. I'm dealing with a navigation list where the list items are set to inline-block. The number of items in the list can change, so it's not fixed. My goal is to make the list items stretch ...

Showing a temporary marker while utilizing jQuery UI sortable container

Incorporating a sortable list of items using jQuery UI in a bootstrap layout has been successfully declared. $("#ReportContainer").sortable({ helper: 'clone', revert: 'invalid', }); Each draggable item represents a column size ra ...

VueDraggable communicates with the database by sending a request during drag and drop interactions

Help needed with the vuedraggable component. I have three columns (photo attached) and I would like to be able to drag BoardUserCard between the columns. Upon dropping the card, I want to send a PUT request to the database to change the "lead_status_id" as ...