A
A
Alexander Wolf2017-05-02 15:34:59
JavaScript
Alexander Wolf, 2017-05-02 15:34:59

How to implement immutable parts in DraftJS?

Good afternoon, comrades!
Can you please tell me how to implement such a thing as variables in the editor? Namely:
1. From the drop-down list, make it possible to select a variable (no questions).
2. After selecting an element, it is processed. For example: { id: "name", label: "Ваше имя" }.
3. After processing, it is inserted into the text field in the form: [Ваше имя]
4. This text cannot be edited, it is hardcoded. You can erase (but immediately the entire inscription).
5. After unloading the state into HTML, the variables should go in the opposite direction: Добрый день, [name]!
I really need help at least in which direction to dig. Now I'm digging towards entity, but so far the result is not enough.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question