M
M
Mikhail Plyusnin2016-09-07 15:21:49
React
Mikhail Plyusnin, 2016-09-07 15:21:49

Dynamic Component via props?

Good afternoon everyone, my question is the following - Is it possible to pass components through ptops? Is it correct?
I have a directory component:

<Directory node={node}
                                       DynamicThingComponent={DynamicThingComponent} //это представление для вещей директории
                                       DynamicDirectoryViewComponent={DynamicDirectoryViewComponent} //это само представление директории
                                       deleteThing={deleteThing} 
                                       deleteDirectory={deleteDirectory}/>

These views can change, in theory everything works, but the question arises, is it possible to do this? If not, what is the best way to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Osher, 2016-09-07
@miraage

You can do this and that's okay. Look at the code of the same react-router.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question