Comments (2)
@HyperMaxime kindly upgrade to 0.8.2.
from react-email-editor.
registerCallback needs to be called inside the onReady function:
exemplo:
const onReady = () => {
emailEditorRef.current.editor.registerCallback('image', function(file, done) {
let files = file.attachments[0]
let reader = new FileReader();
let imageBase64;
console.log("onReady=> emailEditorRef")
console.log("File: ", file)
console.log("FileS: ", files)
reader.onloadend = function () {
imageBase64 = reader.result;
console.log("64 =>", imageBase64)
}
if (file) {
reader.readAsDataURL(files);
}
};
}
remembering that onReady must be inside the EmailEditor component as well as the other props you need.
<EmailEditor ref={emailEditorRef} onLoad={onLoad} onReady={onReady} saveDesign={saveDesign} options={{locale: 'pt-BR'}} />
from react-email-editor.
Related Issues (20)
- the "most" powerful react editor HOT 1
- Cannot read properties of undefined (reading 'values') HOT 1
- x.addEventListener is not a function HOT 1
- Missing license on Unlayer types , unable to use
- Potential XSS vulnerability HOT 1
- "Smart Text" doesn't work with error "Failed to fetch" in smartTextModal
- [Bug] Merge tags in template not loading HOT 2
- how to adjust right panel width? HOT 2
- window is not defined error with Remix 2.0 HOT 4
- CORS and 502 Bad Gateway Errors When Fetching from https://api.events.unlayer.com/usage HOT 2
- How can I add callback to form tool? HOT 1
- Window half-height? HOT 1
- Impossible to dynamically update data without re-rendering the entire Editor HOT 2
- Too much memory usage recently HOT 1
- Error while trying to registerCallback HOT 3
- BUG: The callback for 'previewHtml' renders mergetags before allowing interaction
- "window is not defined" in NextJS. HOT 4
- Increase in input field length in exported HTML
- Embed Display Conditions Doesn't work properly for Outlook mobile.
- Background image is not responsive like another main image.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-email-editor.