Manush
Manush

Reputation: 1942

How to use Nodejs package in Reactjs Application?

I want to use this library in my react project

https://www.npmjs.com/package/color-convert

But I couldn't find this package for Reactjs Application. Please provide a solution to use this package in my reactjs application without any issue.

Thanks in Advance.

Upvotes: 1

Views: 1482

Answers (1)

Dennis Vash
Dennis Vash

Reputation: 53874

Its npm package, you can use it in your React application as is.

npm install color-convert

# or
yarn add color-convert
import convert from 'color-convert';

const App = () => {
  const [hsl,setHsl] = useState(convert.rgb.hsl(140, 200, 100));
  return <>...</>
}

Upvotes: 1

Related Questions