1

I know this is an old question and get many solutions in stack overflow but I tried them all and didn't get any solution for this so I am posting it here.

I am having this type of object here as you can see in below picture.

enter image description here

I want this section heading using this object. How can i get this ?

I used Object.keys() method but didn't get success.

Is there any other solution ?

1 Answer 1

1

Object.keys will not work for this you have to use it like this

this.elements[0].constructor.name

and you will get sectionHeading object

But this will give error in production build like below.

However: beware that the name will likely be different when using minified code.

So you can try this solution also

  this.elements.forEach((ele) => {
        if(ele instanceof SectionHeading){
          // your code here
        }
      })
Sign up to request clarification or add additional context in comments.

Comments

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.