Answer the question
In order to leave comments, you need to log in
How to implement requests via REST?
Hello, help me implement these scenarios.
- REST returns a STRING that contains the JavaScript function text, such as
ValidateJson(JSON_text);
- REACT has a JSON that is the result of the edited document
- REACT executes a JavaScript function by giving the current JSON of the edited document as an argument.
- Function returns "OK" or an error message
Q: Can REACT execute a JavaScript function sent as text (via REST)?
Answer the question
In order to leave comments, you need to log in
here are 4 ways to create a function from a string, 1 2 4 will do kaaaak probably
https://stackoverflow.com/a/28011280
is this to play around with the language, or a case from life?
if from life, then it might be better to have a module with a function that can be imported in react
import { ValidateJson } from '../utils/functions.js'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question