Hello,
I’ve been hired on a trial to work as a front-end developer and I realized that I can do very little things besides coding. I got a task to create a single React component but I have no idea how to do so since whenever I worked with React I installed the whole app with npm install so I’m unsure about what I’m supposed to do. Can anybody help?
If i understand this correctly, you have to create an independent function (or a class) that return an HTML (using render() function). Check it here in more details: React Components
FCC’s React lessons:
Front End Development Libraries | freeCodeCamp.org
Official React docs:
Getting Started – React (reactjs.org)
Not sure what using npm install has to do with it? You still have to create components.
If you want it to be stand-alone you can use script tags (with or without JSX/babel).
What exactly you have problem with?
If it’s an existing project, there already is a folder/file structure that you should follow. Also there should be something like Storybook (or maybe some test page) where you can display your component in its different states.
If you need to create a standalone React component and publish it to npm, read this: https://docs.npmjs.com/cli/v7/commands/npm-publish
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.