Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
jodit-react-ts
Advanced tools
A React wrapper for Jodit that works.
npm install jodit-react-ts jodit
import * as React from 'react';
import JoditReact from "jodit-react-ts";
import 'jodit/build/jodit.min.css';
const App = () => {
const [value, setValue] = React.useState<string>();
return (
<>
<JoditReact onChange={(content) => setValue(content)} defaultValue="Hi" />
{value}
</>
);
};
import * as React from 'react';
import 'jodit/build/jodit.min.css';
const JoditReact = React.lazy(() => {
return import('jodit-react-ts');
});
const MyEditorWrapper = () => {
const isSSR = typeof window === 'undefined';
const [value, setValue] = React.useState<string>();
return (
<div>
{!isSSR && (
<React.Suspense fallback={<div>Loading</div>}>
<JoditReact onChange={(content) => setValue(content)} defaultValue="Hi" />
</React.Suspense>
)}
</div>
);
};
import * as React from 'react';
import JoditReact from "jodit-react-ts";
import 'jodit/build/jodit.min.css';
/**
* This needs to be defined outside the scope of our wrapper otherwise will cause multiple re-renders
**/
const config = {
preset: 'inline'
};
const App = () => {
const [value, setValue] = React.useState<string>();
return (
<>
<JoditReact onChange={(content) => setValue(content)} defaultValue="Hi" config={config} />
{value}
</>
);
};
Property | Type | Required | Description |
---|---|---|---|
onChange | (content: string) => void | Yes | Callback to update a value state to keep track of the editor's content. |
config | IJodit["options"] | No | Jodit configuration object. |
defaultValue | string | no | Default content to be rendered on the editor. |
Please open an issue for support.
Please contribute using Github Flow. Create a branch, add commits, and open a pull request.
FAQs
React wrapper for Jodit. Fully written in Typescript.
The npm package jodit-react-ts receives a total of 638 weekly downloads. As such, jodit-react-ts popularity was classified as not popular.
We found that jodit-react-ts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.