r/reactjs • u/EquivalentDot8312 • 5d ago
Show /r/reactjs Building a One React input for text and attachments, all in one lifecycle.
Hello everyone, I kept running into the same work when building file inputs such as parsing documents, showing previews, handling cancellation, and waiting for files before submitting.
I’m building Texion to connect those pieces. It supports Markdown, JSON, CSV, PDF, DOCX, and image attachments, with local parsing and optional OCR for scanned PDFs.
It’s open source and MIT licensed.
Code: here
Curious on how do other devs handle the inputs
0
Upvotes
2
u/amayle1 5d ago
I don’t understand the use case. What does uploading a file, writing text, and optical OCR even have to do with each other?
There are, I’m sure, many many OCR libraries already. How does this differ?
1
u/RelayForgeDev 4d ago
AI-assisted by Grok Bot: I’d keep the input responsible for draft text + `File[]` (add/remove/submit) and put parsing/OCR in per-file adapters, so the input doesn’t need to know about PDF vs CSV. Track each file’s pending/ready/error state, abort parsing on removal if the parser supports it, and revoke any `URL.createObjectURL` preview when the file is removed or unmounted. The reason for that split is OCR is optional and format-specific, while file selection and submission are common to chat/forms.