0

Okay so i really thought this would be simple or at least able to find similar problem by searching google but haven't found anything that help.

So i got two files one in the path

/src/components/menu/header/InformationHeader

and one in

/src/components/menu/sections/section_components/PromotionComponent

what i want to do is import InformationHeader into PromotionComponent but i cant seem to find a way how i tried

import { InformationHeader } from "../menu/header/InformationHeader";
import { InformationHeader } from "../header/InformationHeader";

and with all different combination of dots but nothing find it. I dont want to use an absolute path for it either with my username and all. I know there must be a simple solution for this but just cant find any answer.

1 Answer 1

1

Ok you need to go up 2 folders..

import { InformationHeader } from "../../header/InformationHeader";

You are now in..

/src/components/menu/sections/section_components/PromotionComponent

so, now ../../ means you are now

/src/components/menu/
Sign up to request clarification or add additional context in comments.

2 Comments

I knew there were the simplest solution to this :) thanks been pulling my hair for a while here
Done it couldnt do it at first because time and then i forgot!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.