react native sketchpad
npm install react-native-sketchpad
import Sketchpad, { SoftBrush, HardBrush } from "react-native-sketchpad";
// ...
function App() {
const pad = useRef();
const brush = new SoftBrush(3, 7);
const onClear = () => {
pad.current?.clear();
};
const onUndo = () => {
pad.current?.undo();
};
const onSave = () => {
pad.current?.toDataURL((base64) => {
// do save image
});
};
return (
<Sketchpad ref={pad} style={styles.pad} brush={brush} />
);
}
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT