Manu Gupta
Manu Gupta

Reputation: 351

Get DOM element in react native

I am making a js based spreadsheet engine using React Native. The library uses a global document (document.getElementById) object to associate DOM properties. However, I get the following error.

Can't find variable document

I know that there is no "document object" in React Native. Is there a way to access the DOM via the document object so that I can include my js file in the app. Alternatively, is there any other method for the same?

I have tried with WebView but the document object is still undefined.

Upvotes: 1

Views: 2023

Answers (1)

Moti Azu
Moti Azu

Reputation: 5442

DOM is only relevant in web development. In react native you have no DOM, there is a different visual tree that is created via React components.

Upvotes: 3

Related Questions