- Home
- Forum
- React - EJ 2
- Problem to consume context inside a column template
Problem to consume context inside a column template
I need to consume and listen changes of a React context inside a column template.
See the example below:
In this example, I have two column template components:
- ColTemplateFixed: Works fine using as a template or not. It doesn't use "useContext"
- ColTemplateDynamic: Works fine outside the grid but it doesn't work when used as column template. It use "useContext".
I put two "console.log" in ColTemplateDynamic to check.
The grid start the render but crashes silently when try to call "useContext".
I think that the problem is in file: "@syncfusion/ej2-react-base/src/template.js" in this instruction: "ReactDOM.render(actTemplate(actData), ele);"
When the grid uses "ReactDOM.render" to render the template, I lose the ability to access the context.
Redux not works because it uses context, too.
There's another way to make this work?
SIGN IN To post a reply.
3 Replies
RS
Rajapandiyan Settu
Syncfusion Team
April 24, 2020 01:00 PM UTC
Hi Angelo,
Greetings from syncfusion support.
Query : When the grid uses "ReactDOM.render" to render the template, I lose the ability to access the context.
Redux not works because it uses context, too.
We were able to reproduce the issue “Accessing application context inside EJ2 React template” and we confirm this as a bug and logged a defect report. You can keep track of the bug from the feedback portal below.
Link: https://www.syncfusion.com/feedback/13807/accessing-the-application-context-inside-ej2-react-template
Link: https://www.syncfusion.com/feedback/13807/accessing-the-application-context-inside-ej2-react-template
The fix will be available in our upcoming Volume / SP release which is scheduled to be rolled out at the end of June, 2020.
If you have any more specification/precise replication procedure or a scenario to be tested you can add it as a comment in the portal.
Regards,
Rajapandiyan S
JB
Jacob Blazina
January 4, 2021 05:01 PM UTC
Is there any update on this? Having the same problem
RS
Rajapandiyan Settu
Syncfusion Team
January 5, 2021 01:23 PM UTC
Hi Jacob,
Thanks for contacting Syncfusion support.
We are glad to announce that our Essential Studio 2020 Volume 3 Release v18.3.0.35 is rolled out and is available for download under the following link.
In that release, we have included the fix for “Accessing the application context inside React template”. Kindly upgrade your version to v18.3.35 or use latest version to avail of this fix.
Please get back to us if you would require any further assistance.
Regards,
Rajapandiyan S
SIGN IN To post a reply.
- 3 Replies
- 3 Participants
-
AN Angelo
- Apr 16, 2020 01:02 PM UTC
- Jan 5, 2021 01:23 PM UTC