Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

How to use in react project #57

Open
SaeedZhiany opened this issue Nov 13, 2019 · 6 comments
Open

How to use in react project #57

SaeedZhiany opened this issue Nov 13, 2019 · 6 comments

Comments

@SaeedZhiany
Copy link

Is it possible to use this library in react projects?

@Dominator008
Copy link
Contributor

Should be. wgxpath is exported as a global on window.

@SaeedZhiany
Copy link
Author

Is there any way in a more react-like way?
I mean something like below:

import wgxpath from 'wicked-good-xpath';

wgxpath.evaluate(/*Some xpath*/);

@Dominator008
Copy link
Contributor

Unfortunately that's not supported. This library pre-dates ES2015 or even CommonJS modules :P

@SaeedZhiany
Copy link
Author

Is there any chance to support it in near future? or this repository is no longer maintained?

@Dominator008
Copy link
Contributor

We are not adding new functionalities or changing how it's exported. I think you can still add it to your html and access wgxpath from window, right?

@SaeedZhiany
Copy link
Author

yeah, it should be possible, but it's not a normal way in react projects.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants